@ybotok/loam 0.2.0-alpha.4 → 0.2.0-alpha.6

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.
Files changed (270) hide show
  1. package/CHANGELOG.md +947 -0
  2. package/MIGRATING-from-OpenSpec.md +7 -1
  3. package/QUICKSTART.md +8 -3
  4. package/README.md +20 -13
  5. package/ROADMAP.md +329 -22
  6. package/SCHEMA.md +472 -24
  7. package/WORKFLOW.md +23 -10
  8. package/dist/commands/adopt/render.js +47 -8
  9. package/dist/commands/adopt/render.js.map +1 -1
  10. package/dist/commands/archive/plan/landscape.js +45 -1
  11. package/dist/commands/archive/plan/landscape.js.map +1 -1
  12. package/dist/commands/archive/plan/model/extending.js +85 -0
  13. package/dist/commands/archive/plan/model/extending.js.map +1 -0
  14. package/dist/commands/archive/run.js +5 -2
  15. package/dist/commands/archive/run.js.map +1 -1
  16. package/dist/commands/context/print.js +11 -1
  17. package/dist/commands/context/print.js.map +1 -1
  18. package/dist/commands/doctor.js +46 -0
  19. package/dist/commands/doctor.js.map +1 -1
  20. package/dist/commands/explore.js +12 -2
  21. package/dist/commands/explore.js.map +1 -1
  22. package/dist/commands/list/views.js +5 -1
  23. package/dist/commands/list/views.js.map +1 -1
  24. package/dist/commands/seed/plan.js +97 -3
  25. package/dist/commands/seed/plan.js.map +1 -1
  26. package/dist/commands/seed/seed.js +7 -2
  27. package/dist/commands/seed/seed.js.map +1 -1
  28. package/dist/commands/show/feature.js +2 -1
  29. package/dist/commands/show/feature.js.map +1 -1
  30. package/dist/commands/show/marks.js +3 -5
  31. package/dist/commands/show/marks.js.map +1 -1
  32. package/dist/commands/show/service.js +39 -18
  33. package/dist/commands/show/service.js.map +1 -1
  34. package/dist/commands/subsystem/sync.js +184 -39
  35. package/dist/commands/subsystem/sync.js.map +1 -1
  36. package/dist/commands/subsystem/txn/exclude.js +132 -0
  37. package/dist/commands/subsystem/txn/exclude.js.map +1 -0
  38. package/dist/commands/subsystem/txn/report.js +124 -0
  39. package/dist/commands/subsystem/txn/report.js.map +1 -0
  40. package/dist/commands/subsystem/txn/txn.js +29 -3
  41. package/dist/commands/subsystem/txn/txn.js.map +1 -1
  42. package/dist/commands/subsystem/txn/views.js +113 -16
  43. package/dist/commands/subsystem/txn/views.js.map +1 -1
  44. package/dist/commands/validate/arch-coverage.js +16 -9
  45. package/dist/commands/validate/arch-coverage.js.map +1 -1
  46. package/dist/commands/validate/checks/fleet-shape.js +30 -77
  47. package/dist/commands/validate/checks/fleet-shape.js.map +1 -1
  48. package/dist/commands/validate/checks/vocabulary.js +4 -19
  49. package/dist/commands/validate/checks/vocabulary.js.map +1 -1
  50. package/dist/commands/validate/feature.js +1 -1
  51. package/dist/commands/validate/feature.js.map +1 -1
  52. package/dist/commands/validate/fleet/census.js +11 -10
  53. package/dist/commands/validate/fleet/census.js.map +1 -1
  54. package/dist/commands/validate/fleet/landscape.js +128 -114
  55. package/dist/commands/validate/fleet/landscape.js.map +1 -1
  56. package/dist/commands/validate/fleet/load.js +66 -0
  57. package/dist/commands/validate/fleet/load.js.map +1 -1
  58. package/dist/commands/validate/fleet/map/attest.js +103 -0
  59. package/dist/commands/validate/fleet/map/attest.js.map +1 -0
  60. package/dist/commands/validate/fleet/map/bindings.js +96 -0
  61. package/dist/commands/validate/fleet/map/bindings.js.map +1 -0
  62. package/dist/commands/validate/fleet/map/consumers.js +298 -0
  63. package/dist/commands/validate/fleet/map/consumers.js.map +1 -0
  64. package/dist/commands/validate/fleet/map/isolation.js +116 -0
  65. package/dist/commands/validate/fleet/map/isolation.js.map +1 -0
  66. package/dist/commands/validate/fleet/map/usecases.js +56 -0
  67. package/dist/commands/validate/fleet/map/usecases.js.map +1 -0
  68. package/dist/commands/validate/fleet/usecases/steps.js +49 -17
  69. package/dist/commands/validate/fleet/usecases/steps.js.map +1 -1
  70. package/dist/commands/validate/fleet/views/fleet-project.js +217 -0
  71. package/dist/commands/validate/fleet/views/fleet-project.js.map +1 -0
  72. package/dist/commands/validate/fleet/views/ids.js +13 -9
  73. package/dist/commands/validate/fleet/views/ids.js.map +1 -1
  74. package/dist/commands/validate/fleet/views/projects.js +278 -0
  75. package/dist/commands/validate/fleet/views/projects.js.map +1 -0
  76. package/dist/commands/validate/fleet/views/root-documents.js +97 -0
  77. package/dist/commands/validate/fleet/views/root-documents.js.map +1 -0
  78. package/dist/commands/validate/fleet/views/stale.js +2 -2
  79. package/dist/commands/validate/fleet/views/stale.js.map +1 -1
  80. package/dist/commands/validate/service/model/diverged.js +226 -0
  81. package/dist/commands/validate/service/model/diverged.js.map +1 -0
  82. package/dist/commands/validate/service/model/grade.js +163 -0
  83. package/dist/commands/validate/service/model/grade.js.map +1 -0
  84. package/dist/commands/validate/service/service.js +110 -34
  85. package/dist/commands/validate/service/service.js.map +1 -1
  86. package/dist/commands/validate/service/specs.js +39 -5
  87. package/dist/commands/validate/service/specs.js.map +1 -1
  88. package/dist/commands/validate/service/spine.js +41 -3
  89. package/dist/commands/validate/service/spine.js.map +1 -1
  90. package/dist/commands/validate/service/usecases/tags.js +113 -0
  91. package/dist/commands/validate/service/usecases/tags.js.map +1 -0
  92. package/dist/commands/validate/service/usecases/usecases.js +209 -0
  93. package/dist/commands/validate/service/usecases/usecases.js.map +1 -0
  94. package/dist/commands/validate/validate.js +10 -24
  95. package/dist/commands/validate/validate.js.map +1 -1
  96. package/dist/core/agent/agents-md/artifacts.js +1 -0
  97. package/dist/core/agent/agents-md/artifacts.js.map +1 -1
  98. package/dist/core/agent/agents-md/command-map.js +18 -2
  99. package/dist/core/agent/agents-md/command-map.js.map +1 -1
  100. package/dist/core/agent/agents-md/cycle.js +24 -9
  101. package/dist/core/agent/agents-md/cycle.js.map +1 -1
  102. package/dist/core/agent/agents-md/map/lenses/context.js +4 -3
  103. package/dist/core/agent/agents-md/map/lenses/context.js.map +1 -1
  104. package/dist/core/agent/agents-md/map/subsystem.js +51 -2
  105. package/dist/core/agent/agents-md/map/subsystem.js.map +1 -1
  106. package/dist/core/agent/agents-md/map/usecases.js +45 -3
  107. package/dist/core/agent/agents-md/map/usecases.js.map +1 -1
  108. package/dist/core/agent/agents-md.js +14 -4
  109. package/dist/core/agent/agents-md.js.map +1 -1
  110. package/dist/core/agent/support/report.js +39 -5
  111. package/dist/core/agent/support/report.js.map +1 -1
  112. package/dist/core/agent/workflows/adopt.js +125 -6
  113. package/dist/core/agent/workflows/adopt.js.map +1 -1
  114. package/dist/core/agent/workflows/check.js +35 -19
  115. package/dist/core/agent/workflows/check.js.map +1 -1
  116. package/dist/core/agent/workflows/closing.js +3 -1
  117. package/dist/core/agent/workflows/closing.js.map +1 -1
  118. package/dist/core/brief/brief.js +63 -11
  119. package/dist/core/brief/brief.js.map +1 -1
  120. package/dist/core/brief/checks.js +138 -3
  121. package/dist/core/brief/checks.js.map +1 -1
  122. package/dist/core/brief/landscape.js +212 -129
  123. package/dist/core/brief/landscape.js.map +1 -1
  124. package/dist/core/brief/map/extend.js +81 -0
  125. package/dist/core/brief/map/extend.js.map +1 -0
  126. package/dist/core/brief/map/owed.js +284 -0
  127. package/dist/core/brief/map/owed.js.map +1 -0
  128. package/dist/core/brief/targets.js +30 -26
  129. package/dist/core/brief/targets.js.map +1 -1
  130. package/dist/core/brief/unchecked.js +12 -2
  131. package/dist/core/brief/unchecked.js.map +1 -1
  132. package/dist/core/c4/likec4.js +23 -1
  133. package/dist/core/c4/likec4.js.map +1 -1
  134. package/dist/core/c4/parsed/deployment.js +5 -3
  135. package/dist/core/c4/parsed/deployment.js.map +1 -1
  136. package/dist/core/c4/parsed/view-ids.js +39 -1
  137. package/dist/core/c4/parsed/view-ids.js.map +1 -1
  138. package/dist/core/c4/prefetch/fleet.js +142 -0
  139. package/dist/core/c4/prefetch/fleet.js.map +1 -0
  140. package/dist/core/c4/project/architecture.js +52 -4
  141. package/dist/core/c4/project/architecture.js.map +1 -1
  142. package/dist/core/c4/project/batch.js +140 -0
  143. package/dist/core/c4/project/batch.js.map +1 -0
  144. package/dist/core/c4/project/documents.js +9 -4
  145. package/dist/core/c4/project/documents.js.map +1 -1
  146. package/dist/core/c4/project/load.js +77 -38
  147. package/dist/core/c4/project/load.js.map +1 -1
  148. package/dist/core/c4/project/staged.js +46 -12
  149. package/dist/core/c4/project/staged.js.map +1 -1
  150. package/dist/core/c4/resolve/attested.js +0 -0
  151. package/dist/core/c4/resolve/attested.js.map +1 -0
  152. package/dist/core/c4/resolve/service.js +8 -17
  153. package/dist/core/c4/resolve/service.js.map +1 -1
  154. package/dist/core/c4/resolve/steps.js +18 -0
  155. package/dist/core/c4/resolve/steps.js.map +1 -1
  156. package/dist/core/c4/root-project/exclude.js +352 -0
  157. package/dist/core/c4/root-project/exclude.js.map +1 -0
  158. package/dist/core/c4/service-model/documents.js +47 -0
  159. package/dist/core/c4/service-model/documents.js.map +1 -0
  160. package/dist/core/c4/service-model/fleet/extending.js +82 -0
  161. package/dist/core/c4/service-model/fleet/extending.js.map +1 -0
  162. package/dist/core/c4/service-model/load.js +165 -0
  163. package/dist/core/c4/service-model/load.js.map +1 -0
  164. package/dist/core/c4/service-model/renderer.js +128 -0
  165. package/dist/core/c4/service-model/renderer.js.map +1 -0
  166. package/dist/core/c4/service-model/shape.js +126 -0
  167. package/dist/core/c4/service-model/shape.js.map +1 -0
  168. package/dist/core/c4/service-model/slice.js +188 -0
  169. package/dist/core/c4/service-model/slice.js.map +1 -0
  170. package/dist/core/c4/source-scan.js +26 -0
  171. package/dist/core/c4/source-scan.js.map +1 -1
  172. package/dist/core/c4/splice/authored-source.js +60 -13
  173. package/dist/core/c4/splice/authored-source.js.map +1 -1
  174. package/dist/core/c4/splice/contract.js.map +1 -1
  175. package/dist/core/c4/splice/identity/declared.js +87 -0
  176. package/dist/core/c4/splice/identity/declared.js.map +1 -0
  177. package/dist/core/c4/splice/identity/edges.js +17 -0
  178. package/dist/core/c4/splice/identity/edges.js.map +1 -1
  179. package/dist/core/c4/splice/identity/existing.js +80 -0
  180. package/dist/core/c4/splice/identity/existing.js.map +1 -0
  181. package/dist/core/c4/splice/identity/interior.js +80 -0
  182. package/dist/core/c4/splice/identity/interior.js.map +1 -0
  183. package/dist/core/c4/splice/identity/owner.js +50 -0
  184. package/dist/core/c4/splice/identity/owner.js.map +1 -0
  185. package/dist/core/c4/splice/landscape-merge.js +154 -100
  186. package/dist/core/c4/splice/landscape-merge.js.map +1 -1
  187. package/dist/core/c4/splice/model/merge.js +140 -0
  188. package/dist/core/c4/splice/model/merge.js.map +1 -0
  189. package/dist/core/c4/splice/placement.js +14 -4
  190. package/dist/core/c4/splice/placement.js.map +1 -1
  191. package/dist/core/c4/workspace.js +2 -1
  192. package/dist/core/c4/workspace.js.map +1 -1
  193. package/dist/core/coherence/coherence.js +7 -0
  194. package/dist/core/coherence/coherence.js.map +1 -1
  195. package/dist/core/delta/delta.js +9 -0
  196. package/dist/core/delta/delta.js.map +1 -1
  197. package/dist/core/deployment/delta.js +4 -0
  198. package/dist/core/deployment/delta.js.map +1 -1
  199. package/dist/core/diff/base-state.js +21 -5
  200. package/dist/core/diff/base-state.js.map +1 -1
  201. package/dist/core/diff/victims.js +10 -1
  202. package/dist/core/diff/victims.js.map +1 -1
  203. package/dist/core/docs.js +31 -22
  204. package/dist/core/docs.js.map +1 -1
  205. package/dist/core/doctor/config.js +7 -3
  206. package/dist/core/doctor/config.js.map +1 -1
  207. package/dist/core/doctor/doctor.js +48 -9
  208. package/dist/core/doctor/doctor.js.map +1 -1
  209. package/dist/core/doctor/report.js.map +1 -1
  210. package/dist/core/doctor/reports/scan.js +242 -0
  211. package/dist/core/doctor/reports/scan.js.map +1 -0
  212. package/dist/core/explain/families.js +1 -1
  213. package/dist/core/explain/families.js.map +1 -1
  214. package/dist/core/explain/refusals.js +1 -1
  215. package/dist/core/explain/refusals.js.map +1 -1
  216. package/dist/core/explore/explore.js +44 -9
  217. package/dist/core/explore/explore.js.map +1 -1
  218. package/dist/core/fleet-context.js +47 -0
  219. package/dist/core/fleet-context.js.map +1 -1
  220. package/dist/core/gate/partners.js +5 -9
  221. package/dist/core/gate/partners.js.map +1 -1
  222. package/dist/core/kernel/ids/fqn/ancestors.js +65 -0
  223. package/dist/core/kernel/ids/fqn/ancestors.js.map +1 -0
  224. package/dist/core/pack/living.js +47 -13
  225. package/dist/core/pack/living.js.map +1 -1
  226. package/dist/core/pack/pack.js +9 -6
  227. package/dist/core/pack/pack.js.map +1 -1
  228. package/dist/core/projection/arch-slice.js +2 -2
  229. package/dist/core/projection/arch-slice.js.map +1 -1
  230. package/dist/core/repo/paths.js +40 -0
  231. package/dist/core/repo/paths.js.map +1 -1
  232. package/dist/core/repo/tree/render/projects.js +182 -0
  233. package/dist/core/repo/tree/render/projects.js.map +1 -0
  234. package/dist/core/repo/tree/render/stale.js +2 -3
  235. package/dist/core/repo/tree/render/stale.js.map +1 -1
  236. package/dist/core/repo/tree/render/views.js +51 -3
  237. package/dist/core/repo/tree/render/views.js.map +1 -1
  238. package/dist/core/repo/tree/walk.js +45 -2
  239. package/dist/core/repo/tree/walk.js.map +1 -1
  240. package/dist/core/scaffold/landscape.js +219 -9
  241. package/dist/core/scaffold/landscape.js.map +1 -1
  242. package/dist/core/staging/writes.js.map +1 -1
  243. package/dist/core/usecases/delta/claims.js +1 -0
  244. package/dist/core/usecases/delta/claims.js.map +1 -1
  245. package/dist/core/usecases/delta/overlay.js +4 -0
  246. package/dist/core/usecases/delta/overlay.js.map +1 -1
  247. package/dist/core/usecases/fleet.js +18 -6
  248. package/dist/core/usecases/fleet.js.map +1 -1
  249. package/dist/core/usecases/operations.js +7 -0
  250. package/dist/core/usecases/operations.js.map +1 -1
  251. package/dist/core/usecases/service/exclude.js +119 -0
  252. package/dist/core/usecases/service/exclude.js.map +1 -0
  253. package/dist/core/usecases/service/flows.js +161 -0
  254. package/dist/core/usecases/service/flows.js.map +1 -0
  255. package/dist/core/vocabulary/maturity.js +10 -0
  256. package/dist/core/vocabulary/maturity.js.map +1 -1
  257. package/examples/README.md +23 -0
  258. package/examples/docs/architecture/landscape.likec4 +41 -0
  259. package/examples/docs/architecture/usecases/order-notification.likec4 +5 -2
  260. package/examples/docs/likec4.config.json +0 -1
  261. package/examples/docs/services/checkout-web/model.likec4 +39 -56
  262. package/examples/docs/services/order-service/arch.spec.md +13 -6
  263. package/examples/docs/services/order-service/model.likec4 +53 -67
  264. package/examples/docs/services/payment-service/arch.spec.md +7 -4
  265. package/examples/docs/services/payment-service/model.likec4 +32 -33
  266. package/examples/docs/services/platform/identity-service/arch.spec.md +7 -4
  267. package/examples/docs/services/platform/identity-service/model.likec4 +29 -33
  268. package/examples/docs/services/platform/notification-service/health.yaml +8 -3
  269. package/examples/docs/services/platform/notification-service/model.likec4 +39 -59
  270. package/package.json +1 -1
@@ -63,11 +63,31 @@ more for secrets before handing it back.
63
63
 
64
64
  ## Write one separate report
65
65
 
66
- Create \`loam-reports/YYYY-MM-DD-<short-slug>.md\` at the current repository root. Use a short neutral
67
- slug based on the symptom, not a customer, person or secret. Never overwrite a different incident;
68
- add a numeric suffix when the path exists. Reports are ordinary project files so the team can
69
- review or commit them deliberately, but do not upload, submit an issue, send telemetry, or contact
70
- any service automatically.
66
+ Create \`loam-reports/NNN-YYYY-MM-DD-<short-slug>.md\` in the directory holding the \`loam.json\` that
67
+ resolved — or, when a \`loam.json\` was found but does not parse, beside that file, so a report about
68
+ the broken config joins the corpus already there; only when there is no config file at or above you
69
+ is it the directory you run in.
70
+ \`loam doctor --json\` hands you that whole directory — that root WITH \`loam-reports/\`
71
+ already on the end — as \`reports.dir\`: write inside the path it gives, never joined onto
72
+ \`loam-reports/\` a second time. \`NNN\` is an ordinal of at least three digits, zero-padded, one more
73
+ than the highest already in that directory — read \`reports.next\` from the same output, which says
74
+ \`001\` when the directory is empty or absent, and widens past three digits rather than reusing a
75
+ number once the corpus gets there. Use a short neutral slug based on the symptom, not a customer,
76
+ person or secret. Never
77
+ overwrite a different incident: a path that already exists means a concurrent report claimed that
78
+ ordinal, so take the next one rather than adding a suffix. That check is on the PATH, and the
79
+ promise is about the ordinal, so re-run \`loam doctor --json\` after writing: if two entries carry
80
+ the same \`ordinal\`, the one with the later \`Recorded\` timestamp renames itself to the next free
81
+ number. The ordinal is the report's handle —
82
+ cite one by its number in a commit message, an issue, or another report's cross-references, and
83
+ never by filename, which is free to be renamed. The ordinal is unique within that directory, not
84
+ across a fleet: a service repository and the docs repository each number their own, so when two
85
+ repositories are in play cite \`<repo>/loam-reports/NNN\`.
86
+
87
+ Reports are ordinary project files so the team can review or commit them deliberately, but
88
+ do not upload, submit an issue, send telemetry, or contact any service automatically.
89
+ \`loam doctor\` reads the directory — how many reports it holds, how many are in each status, and
90
+ which ordinal comes next — and that is a local read of local files: nothing is transmitted.
71
91
 
72
92
  Use this shape, omitting only fields that truly cannot be known and marking them \`not collected\`:
73
93
 
@@ -75,6 +95,7 @@ Use this shape, omitting only fields that truly cannot be known and marking them
75
95
 
76
96
  - Recorded: <ISO-8601 timestamp>
77
97
  - Classification: <one value above>
98
+ - Status: open
78
99
  - Repository role: <docs | service | combined | unresolved>
79
100
  - loam version: <version>
80
101
  - Entry point: <chat command, skill, or CLI command; sanitized>
@@ -91,6 +112,19 @@ Use this shape, omitting only fields that truly cannot be known and marking them
91
112
  ## Missing evidence
92
113
  ## Sanitization
93
114
 
115
+ \`Status\` is written as \`open\` and stays the report's own record of where it got to. The vocabulary
116
+ is \`open\`, \`sent\` (handed to loam's author — the person forwarding a report sets this, never the
117
+ agent writing it), \`fixed in <version>\`, and \`superseded by <NNN>\` naming the report that
118
+ replaced this one. Close a report by editing its own \`Status\` line: there is no index to keep in
119
+ step, and \`loam doctor\` counts the directory by reading that line's first word, so
120
+ \`fixed in 0.2.0-alpha.5\` counts as fixed. It reads that line from the HEADER FIELD BLOCK only —
121
+ the lines above the first \`##\` heading, quoted code skipped in either markdown spelling: a fence
122
+ (closed only by a run of the same character at least as long as the one that opened it, so a
123
+ \`\`\` inside a \`\`\`\` block is content) and an indented block, which is the shape THIS template is
124
+ printed in above. So a report that quotes this template, however it quotes it, still counts as
125
+ whatever its own header says. A report written before this
126
+ field existed has no \`Status\` line and counts as unstated.
127
+
94
128
  In \`Machine contract\`, include exit code plus the stable envelope fields and relevant finding
95
129
  codes/locations; do not paste an entire large JSON payload. In \`Sanitization\`, list the kinds of
96
130
  values removed without revealing them. If no workaround is known, say so rather than inventing one.
@@ -1 +1 @@
1
- {"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../src/core/agent/support/report.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,uFAAuF;IACzF,YAAY,EAAE,EAAE;IAChB,OAAO,EACL,oOAAoO;IACtO,UAAU,EAAE,+BAA+B;IAC3C,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE;QACL,+EAA+E;QAC/E,iFAAiF;QACjF,yFAAyF;QACzF,gFAAgF;QAChF,wFAAwF;KACzF;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFP;CACA,CAAC","sourcesContent":["import type { CommandContent } from \"../contract.js\";\n\n/**\n * The incident-reporting protocol: preserve a small, sanitized reproducer when\n * loam or its agent integration behaves unexpectedly, without turning loam\n * into a telemetry service or retrying a risky write.\n */\nexport const LOAM_REPORT: CommandContent = {\n name: \"loam-report\",\n description:\n \"Record unexpected loam or agent behavior as a sanitized, reproducible Markdown report\",\n argumentHint: \"\",\n purpose:\n \"Collect one unexpected loam or agent-integration incident into a separate, reviewable Markdown file. This is local diagnostics only: redact secrets, never upload automatically, and never repeat a writer merely to reproduce it.\",\n invocation: \"loam instructions loam-report\",\n placeholders: [],\n spine: [\n \"preserve the user's original symptom and expected result before investigating\",\n \"collect the binary version, wiring diagnosis and the smallest safe reproduction\",\n \"classify the failure without repairing, retrying a writer or changing project documents\",\n \"sanitize commands, paths and output, then write one report under loam-reports/\",\n \"hand back the report path, classification and any evidence that could not be collected\",\n ],\n body: `Record one incident where loam, a generated command/skill, or the agent following it\nbehaved unexpectedly. The result is a local diagnostic document, not a repair and not telemetry.\nDo not change architecture/spec files while collecting it.\n\n## Preserve the symptom first\n\nBefore running anything, write down the user's original request, what they expected, what actually\nhappened, the command or chat entry point involved, and whether any files may already have changed.\nDo not improve or reinterpret the failing command yet: a cleaned-up command is not a reproduction.\n\nClassify the incident as one of these, using \\`inconclusive\\` until the evidence supports another:\n\n- \\`loam-product\\` — the binary violated its documented contract or produced internally inconsistent output;\n- \\`project-data\\` — the binary correctly reported invalid, incomplete or stale repository documents;\n- \\`agent-workflow\\` — the generated command/skill was missing, stale, misrouted or followed incorrectly;\n- \\`host-infrastructure\\` — permissions, filesystem, process, shell or tool-host behavior prevented the run;\n- \\`inconclusive\\` — the available evidence does not distinguish the above.\n\n## Collect only safe evidence\n\n1. Run \\`loam --version\\` and record the result.\n2. Run \\`loam doctor --json\\`. If it succeeds, keep \\`healthy\\`, the finding codes and their structured\n locations/fixes, the resolved repository role, and the write-path state. If it refuses, keep\n \\`error.code\\` and the sanitized message. Do not apply the fixes during reporting.\n3. When the repository is wired, run \\`loam status --json\\` and keep only the state and next-action\n rows relevant to this incident. A refusal is evidence too; keep its \\`error.code\\`.\n4. Re-run the original operation only when it is read-only and safe. Never re-run \\`init\\`, \\`new\\`,\n \\`rebase\\`, \\`subsystem\\`, \\`archive\\`, \\`unarchive\\`, \\`vouch\\`, a recording form of \\`verify\\`, or\n any other writer merely to make it fail twice. For a writer, record its original exit/output and\n inspect \\`doctor\\`, \\`status\\` and version only. Do not repair, roll back or delete anything unless\n the user separately asks for that action.\n5. Prefer the JSON envelope: record \\`contractVersion\\`, \\`ok\\`, \\`command\\`, \\`error.code\\`, finding\n codes and \\`locations[]\\`. Quote only the smallest stdout/stderr excerpt that demonstrates the\n symptom. State what was omitted.\n\n## Sanitize before writing\n\nNever include credentials, tokens, cookies, authorization headers, private keys, environment dumps,\nor values of variables whose names contain \\`TOKEN\\`, \\`SECRET\\`, \\`PASSWORD\\`, \\`AUTH\\`, \\`COOKIE\\` or\n\\`KEY\\`. Replace each value with \\`<redacted>\\`. Replace the user's home directory with \\`<home>\\` and\nprefer repository-relative paths. Do not copy source files, architecture/spec bodies, or a complete\ncommand output when a code and short excerpt prove the same fact. Review the finished report once\nmore for secrets before handing it back.\n\n## Write one separate report\n\nCreate \\`loam-reports/YYYY-MM-DD-<short-slug>.md\\` at the current repository root. Use a short neutral\nslug based on the symptom, not a customer, person or secret. Never overwrite a different incident;\nadd a numeric suffix when the path exists. Reports are ordinary project files so the team can\nreview or commit them deliberately, but do not upload, submit an issue, send telemetry, or contact\nany service automatically.\n\nUse this shape, omitting only fields that truly cannot be known and marking them \\`not collected\\`:\n\n # loam problem report: <short title>\n\n - Recorded: <ISO-8601 timestamp>\n - Classification: <one value above>\n - Repository role: <docs | service | combined | unresolved>\n - loam version: <version>\n - Entry point: <chat command, skill, or CLI command; sanitized>\n - Side effects observed: <none known | paths changed | unknown>\n\n ## Summary\n ## Expected\n ## Actual\n ## Minimal safe reproduction\n ## Machine contract\n ## Doctor and status evidence\n ## Files changed or write state\n ## Workaround\n ## Missing evidence\n ## Sanitization\n\nIn \\`Machine contract\\`, include exit code plus the stable envelope fields and relevant finding\ncodes/locations; do not paste an entire large JSON payload. In \\`Sanitization\\`, list the kinds of\nvalues removed without revealing them. If no workaround is known, say so rather than inventing one.\n\nFinish by telling the user the report path, classification, whether project files changed, and which\nevidence was unavailable. Keep diagnosis separate from certainty: a plausible cause belongs under\n\\`Summary\\` as a hypothesis until the reproduction proves it.\n`,\n};\n"]}
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../src/core/agent/support/report.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,uFAAuF;IACzF,YAAY,EAAE,EAAE;IAChB,OAAO,EACL,oOAAoO;IACtO,UAAU,EAAE,+BAA+B;IAC3C,YAAY,EAAE,EAAE;IAChB,KAAK,EAAE;QACL,+EAA+E;QAC/E,iFAAiF;QACjF,yFAAyF;QACzF,gFAAgF;QAChF,wFAAwF;KACzF;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmHP;CACA,CAAC","sourcesContent":["import type { CommandContent } from \"../contract.js\";\n\n/**\n * The incident-reporting protocol: preserve a small, sanitized reproducer when\n * loam or its agent integration behaves unexpectedly, without turning loam\n * into a telemetry service or retrying a risky write.\n */\nexport const LOAM_REPORT: CommandContent = {\n name: \"loam-report\",\n description:\n \"Record unexpected loam or agent behavior as a sanitized, reproducible Markdown report\",\n argumentHint: \"\",\n purpose:\n \"Collect one unexpected loam or agent-integration incident into a separate, reviewable Markdown file. This is local diagnostics only: redact secrets, never upload automatically, and never repeat a writer merely to reproduce it.\",\n invocation: \"loam instructions loam-report\",\n placeholders: [],\n spine: [\n \"preserve the user's original symptom and expected result before investigating\",\n \"collect the binary version, wiring diagnosis and the smallest safe reproduction\",\n \"classify the failure without repairing, retrying a writer or changing project documents\",\n \"sanitize commands, paths and output, then write one report under loam-reports/\",\n \"hand back the report path, classification and any evidence that could not be collected\",\n ],\n body: `Record one incident where loam, a generated command/skill, or the agent following it\nbehaved unexpectedly. The result is a local diagnostic document, not a repair and not telemetry.\nDo not change architecture/spec files while collecting it.\n\n## Preserve the symptom first\n\nBefore running anything, write down the user's original request, what they expected, what actually\nhappened, the command or chat entry point involved, and whether any files may already have changed.\nDo not improve or reinterpret the failing command yet: a cleaned-up command is not a reproduction.\n\nClassify the incident as one of these, using \\`inconclusive\\` until the evidence supports another:\n\n- \\`loam-product\\` — the binary violated its documented contract or produced internally inconsistent output;\n- \\`project-data\\` — the binary correctly reported invalid, incomplete or stale repository documents;\n- \\`agent-workflow\\` — the generated command/skill was missing, stale, misrouted or followed incorrectly;\n- \\`host-infrastructure\\` — permissions, filesystem, process, shell or tool-host behavior prevented the run;\n- \\`inconclusive\\` — the available evidence does not distinguish the above.\n\n## Collect only safe evidence\n\n1. Run \\`loam --version\\` and record the result.\n2. Run \\`loam doctor --json\\`. If it succeeds, keep \\`healthy\\`, the finding codes and their structured\n locations/fixes, the resolved repository role, and the write-path state. If it refuses, keep\n \\`error.code\\` and the sanitized message. Do not apply the fixes during reporting.\n3. When the repository is wired, run \\`loam status --json\\` and keep only the state and next-action\n rows relevant to this incident. A refusal is evidence too; keep its \\`error.code\\`.\n4. Re-run the original operation only when it is read-only and safe. Never re-run \\`init\\`, \\`new\\`,\n \\`rebase\\`, \\`subsystem\\`, \\`archive\\`, \\`unarchive\\`, \\`vouch\\`, a recording form of \\`verify\\`, or\n any other writer merely to make it fail twice. For a writer, record its original exit/output and\n inspect \\`doctor\\`, \\`status\\` and version only. Do not repair, roll back or delete anything unless\n the user separately asks for that action.\n5. Prefer the JSON envelope: record \\`contractVersion\\`, \\`ok\\`, \\`command\\`, \\`error.code\\`, finding\n codes and \\`locations[]\\`. Quote only the smallest stdout/stderr excerpt that demonstrates the\n symptom. State what was omitted.\n\n## Sanitize before writing\n\nNever include credentials, tokens, cookies, authorization headers, private keys, environment dumps,\nor values of variables whose names contain \\`TOKEN\\`, \\`SECRET\\`, \\`PASSWORD\\`, \\`AUTH\\`, \\`COOKIE\\` or\n\\`KEY\\`. Replace each value with \\`<redacted>\\`. Replace the user's home directory with \\`<home>\\` and\nprefer repository-relative paths. Do not copy source files, architecture/spec bodies, or a complete\ncommand output when a code and short excerpt prove the same fact. Review the finished report once\nmore for secrets before handing it back.\n\n## Write one separate report\n\nCreate \\`loam-reports/NNN-YYYY-MM-DD-<short-slug>.md\\` in the directory holding the \\`loam.json\\` that\nresolved — or, when a \\`loam.json\\` was found but does not parse, beside that file, so a report about\nthe broken config joins the corpus already there; only when there is no config file at or above you\nis it the directory you run in.\n\\`loam doctor --json\\` hands you that whole directory — that root WITH \\`loam-reports/\\`\nalready on the end — as \\`reports.dir\\`: write inside the path it gives, never joined onto\n\\`loam-reports/\\` a second time. \\`NNN\\` is an ordinal of at least three digits, zero-padded, one more\nthan the highest already in that directory — read \\`reports.next\\` from the same output, which says\n\\`001\\` when the directory is empty or absent, and widens past three digits rather than reusing a\nnumber once the corpus gets there. Use a short neutral slug based on the symptom, not a customer,\nperson or secret. Never\noverwrite a different incident: a path that already exists means a concurrent report claimed that\nordinal, so take the next one rather than adding a suffix. That check is on the PATH, and the\npromise is about the ordinal, so re-run \\`loam doctor --json\\` after writing: if two entries carry\nthe same \\`ordinal\\`, the one with the later \\`Recorded\\` timestamp renames itself to the next free\nnumber. The ordinal is the report's handle —\ncite one by its number in a commit message, an issue, or another report's cross-references, and\nnever by filename, which is free to be renamed. The ordinal is unique within that directory, not\nacross a fleet: a service repository and the docs repository each number their own, so when two\nrepositories are in play cite \\`<repo>/loam-reports/NNN\\`.\n\nReports are ordinary project files so the team can review or commit them deliberately, but\ndo not upload, submit an issue, send telemetry, or contact any service automatically.\n\\`loam doctor\\` reads the directory — how many reports it holds, how many are in each status, and\nwhich ordinal comes next — and that is a local read of local files: nothing is transmitted.\n\nUse this shape, omitting only fields that truly cannot be known and marking them \\`not collected\\`:\n\n # loam problem report: <short title>\n\n - Recorded: <ISO-8601 timestamp>\n - Classification: <one value above>\n - Status: open\n - Repository role: <docs | service | combined | unresolved>\n - loam version: <version>\n - Entry point: <chat command, skill, or CLI command; sanitized>\n - Side effects observed: <none known | paths changed | unknown>\n\n ## Summary\n ## Expected\n ## Actual\n ## Minimal safe reproduction\n ## Machine contract\n ## Doctor and status evidence\n ## Files changed or write state\n ## Workaround\n ## Missing evidence\n ## Sanitization\n\n\\`Status\\` is written as \\`open\\` and stays the report's own record of where it got to. The vocabulary\nis \\`open\\`, \\`sent\\` (handed to loam's author — the person forwarding a report sets this, never the\nagent writing it), \\`fixed in <version>\\`, and \\`superseded by <NNN>\\` naming the report that\nreplaced this one. Close a report by editing its own \\`Status\\` line: there is no index to keep in\nstep, and \\`loam doctor\\` counts the directory by reading that line's first word, so\n\\`fixed in 0.2.0-alpha.5\\` counts as fixed. It reads that line from the HEADER FIELD BLOCK only —\nthe lines above the first \\`##\\` heading, quoted code skipped in either markdown spelling: a fence\n(closed only by a run of the same character at least as long as the one that opened it, so a\n\\`\\`\\` inside a \\`\\`\\`\\` block is content) and an indented block, which is the shape THIS template is\nprinted in above. So a report that quotes this template, however it quotes it, still counts as\nwhatever its own header says. A report written before this\nfield existed has no \\`Status\\` line and counts as unstated.\n\nIn \\`Machine contract\\`, include exit code plus the stable envelope fields and relevant finding\ncodes/locations; do not paste an entire large JSON payload. In \\`Sanitization\\`, list the kinds of\nvalues removed without revealing them. If no workaround is known, say so rather than inventing one.\n\nFinish by telling the user the report path, classification, whether project files changed, and which\nevidence was unavailable. Keep diagnosis separate from certainty: a plausible cause belongs under\n\\`Summary\\` as a hypothesis until the reproduction proves it.\n`,\n};\n"]}
@@ -10,7 +10,7 @@ export const LOAM_ADOPT = {
10
10
  "wire this repo (`loam init`, then `loam doctor`) if it has no ./loam.json yet",
11
11
  "`loam adopt` — the brief: the order to read the service in, every file to write, the grammar of each, and what the fleet map already says",
12
12
  "walk the service in the brief's order — shape first, then one surface at a time — keeping the list of every path you open, because that list becomes `sources`",
13
- "write the artifacts, everything `status: draft`",
13
+ "write the artifacts, everything `status: draft` — the model EXTENDS the fleet map — then `loam subsystem sync` for the renderer wiring, which is loam's and never yours",
14
14
  "validate the service, then validate the whole fleet — a baseline that passes one and fails the other is documented and invisible",
15
15
  "hand back with what you could not determine from the code, which directories you never opened, the branch-to-scenario count per operation, and three behaviours your documents do not describe — then let a human vouch",
16
16
  ],
@@ -43,6 +43,13 @@ thin baseline that validates is thin, not done.
43
43
  read it, diff your findings against it, report what disagrees. Do not replace it.
44
44
  \`action: "edit"\` appears on exactly one target — \`architecture/landscape.likec4\`,
45
45
  the WHOLE FLEET's map: add this service's element and edges to it, never rewrite it.
46
+ It appears while nothing resolves to the service AND while the element that does
47
+ has no edge touching it; \`targets[].shape\` says which of the two you are in.
48
+ It does NOT appear when loam could not READ the map (\`landscape.modelled: null\`
49
+ — a broken landscape, or a broken sibling under \`architecture/\`): nothing is
50
+ known about what the map already draws, so no write to the whole fleet's map is
51
+ briefed. \`landscape.instruction\` carries the answer and names the documents that
52
+ failed; fix those and re-run.
46
53
  - \`targets[].shape\` — the grammar of each artifact, and \`example\` where one is
47
54
  shorter than a description. Every rule there is one a later check depends on;
48
55
  rules nothing checks are in \`unchecked[]\` instead, and are still worth following.
@@ -50,7 +57,13 @@ thin baseline that validates is thin, not done.
50
57
  Bind to them; do not draw a second version of the same box. \`landscape.expects\`
51
58
  lists operations other services already call — your openapi.yaml owes them.
52
59
  \`landscape.instruction\` is the write the fleet map still owes this service; it
53
- is \`null\` once an element resolves to it, and only then.
60
+ is \`null\` once an element resolves to it AND at least one edge ANYWHERE in the
61
+ \`architecture/\` project touches that element (\`landscape.touched\`), and only
62
+ then — one edge closes the state, so draw every call in one pass.
63
+ \`landscape.attested\` lists the
64
+ calls \`services/$1/model.likec4\` already declares across its boundary — those
65
+ are the edges the map owes, collapsed to the service; an empty list on a
66
+ service with no model is not licence to invent one, and the instruction says so.
54
67
  - \`frontmatter\` — what to put in the header of every markdown artifact.
55
68
  - \`checks[]\` — what \`loam validate\` will run. \`unchecked[]\` — what it will not.
56
69
  2. Read \`AGENTS.md\` at the docs repo root, then walk the service — \`walk[]\` in the
@@ -70,22 +83,128 @@ thin baseline that validates is thin, not done.
70
83
  tying the document to the repository. Never pad it with paths you did not read:
71
84
  it is a record, and \`loam vouch\` hashes exactly what it names.
72
85
  3. Write the artifacts under \`services/$1/\`, in the order the brief lists them, and
73
- make the landscape edit the brief asks for.
86
+ make the landscape edit the brief asks for — the element where none resolves, the
87
+ edges where the element stands alone, and the map's own housekeeping
88
+ \`unchecked[]\` names: a placeholder tag to clear, a curated view to add the
89
+ element to.
90
+ **model.likec4 EXTENDS the fleet map.** It declares no \`specification\` block and
91
+ no copy of anything the map already draws: its whole body is
92
+ \`model { extend <fqn> { …containers… } }\`, where \`<fqn>\` is the FULLY-QUALIFIED
93
+ id of the element bound to \`services/$1/\` (the brief's \`landscape.elements\` names
94
+ it; \`extend orderService\` resolves to nothing when the id is
95
+ \`marketplace.orderService\`). Kinds and tags come from
96
+ \`architecture/landscape.likec4\` — a kind you need and the map does not declare
97
+ (\`element database\`, \`element queue\`) is added THERE, once, in the same landscape
98
+ edit. Cross-boundary edges are written OUTSIDE the extend block, from the container
99
+ that makes the call to the other party's element as the map spells it; an element
100
+ this file declares outside its own is \`c4.element-unowned\` (warn), and which fix
101
+ applies depends on whose it is — a store or component this service OWNS belongs
102
+ INSIDE the \`extend\` block (its id becomes \`<fqn>.<name>\`), a system the service
103
+ merely reaches is declared in the map instead, and another service's internals
104
+ belong in that service's model. If you are DIFFING an existing model
105
+ that carries its own \`specification\`, leave it alone: that shape is still legal
106
+ and still parsed on its own, and \`c4.declaration-diverged\` is what reports where
107
+ its copies of the map's elements have drifted. Migrating one is the recipe in
108
+ SCHEMA.md, "Two shapes of a service model" — not something to do inside an
109
+ adoption you were not asked to widen.
110
+ A flow behind one of your arch.spec.md requirements — a \`dynamic view\`
111
+ over this service's own containers — goes in a \`.likec4\` beside model.likec4
112
+ (\`services/$1/usecases/<name>.likec4\` by convention; \`views.likec4\` reads the
113
+ same, because the renderer's per-service project reads every \`.likec4\` under the
114
+ directory and so does loam), tagged \`#req-<Requirement-ID>\` of a requirement in
115
+ this service's spec.md or arch.spec.md, with the tag declared in the map's
116
+ \`specification\` block or in a tags-only \`specification { tag req-… }\` beside the
117
+ \`extend\` — in exactly ONE of the two. Declared in both, the model's own project
118
+ holds the tag twice: the error lands on whichever document carries the second
119
+ declaration, as \`c4.invalid\` (an error, and the model's grading is suspended
120
+ behind it) when that is model.likec4, or as \`usecase.flow-invalid\` when it is the
121
+ sibling. Step 4 grades it. It never goes in \`architecture/usecases/\`,
122
+ which cannot see your containers and turns the whole fleet \`landscape.invalid\`; a
123
+ flow that crosses services goes there and is tagged \`#cap-\`. Never a \`#cap-\` tag
124
+ beside a model. Then run \`loam subsystem sync\` (from
125
+ this repo or the docs repo — it resolves \`docsDir\`): once the docs root carries
126
+ the \`likec4.config.json\` step 0's doctor asks for, it keeps that file's
127
+ \`exclude\` list covering exactly the service directories whose models stand alone —
128
+ so an extending model stays inside the root project, where it is the only place it
129
+ parses and where the renderer draws it beside the map — and writes
130
+ \`services/<…>/<id>/likec4.config.json\` beside each STANDALONE model that has none.
131
+ Both are loam's — never write one yourself, never list it in \`sources\`, never
132
+ diff it, never hand-edit the root \`exclude\`'s \`services/\` entries — and \`sync\`
133
+ leaves what it wrote untracked for you to commit. A repo whose models all extend
134
+ the map usually has nothing for \`sync\` to write here, and that is the healthy
135
+ state, not a skipped step.
74
136
  Everything \`status: draft\`. Never write \`last_verified\`, \`sources_digest\`,
75
137
  \`content_digest\` or \`sources_files\`.
76
- 4. \`loam validate --service $1 --json\`. Fix every error. \`sources.unvouched\` is
138
+ 4. \`loam validate --service $1 --json\`. Fix every error. \`c4.valid\` reading
139
+ "extends the fleet map" is the confirmation that the model was read as one
140
+ document with the map; \`c4.invalid\` on this run means the model plus the map do
141
+ not parse together, and every error is YOURS even where the message names
142
+ \`architecture/landscape.likec4\` — the map parses clean on its own, or
143
+ \`spine.landscape-invalid\` would say so instead and this model could not be read
144
+ at all. \`c4.element-unowned\` (warn) is an element you declared outside the
145
+ element you extend — nest it inside the \`extend\` block if this service owns it,
146
+ declare it in the map if the service only reaches it. \`sources.unvouched\` is
77
147
  expected on a fresh baseline — it closes when a person vouches, not when you do.
78
148
  \`sources.unwalked\` is the walk graded against the repository: its \`details\` name
79
149
  the top-level paths git tracks and \`sources\` never reached into. Treat each one
80
150
  as a place to go back to, not as a line to silence — the fix is reading it, or
81
151
  one sentence in step 6 saying why this document does not owe it.
152
+ \`usecase.*\` findings on this run are about the flows beside model.likec4:
153
+ \`usecase.step-unbacked\` is a hop no relationship in model.likec4 backs,
154
+ \`usecase.step-contested\` two edges backing one hop and naming different
155
+ operations, \`usecase.requirement-unresolved\` a \`#req-\` tag naming no
156
+ \`Requirement-ID:\` of this service's spec.md or arch.spec.md,
157
+ \`usecase.capability-unresolved\` a \`#cap-\` tag beside a model (drop it — a
158
+ capability is claimed on the fleet map, never inside one service), and
159
+ \`usecase.flow-invalid\` a file beside the model that does not read — the flows
160
+ were not graded, the model still was. \`usecase.step-unlinked\` never fires on a hop
161
+ whose caller and provider resolve to the same service — a service owes no
162
+ operationId to itself — but a hop from such a flow into another service's element
163
+ (a stand-in model.likec4 declares for a sibling, with no \`metadata { op }\`) still
164
+ warns here, exactly as it does on the fleet map.
82
165
  5. \`loam validate --all --json\` in the docs repo. This is the run that grades the
83
166
  fleet map: \`landscape.service-unmodelled\` means the element never landed,
84
167
  \`landscape.binding-unknown\` / \`landscape.binding-duplicate\` mean it landed wrong,
85
168
  and \`landscape.missing\` means there is no map at all. A baseline that passes step 4
86
169
  and fails this one is documented and invisible.
87
- Done, stated once: step 4 clean when run from inside the service's own repo, and
88
- this run reporting no \`landscape.*\` finding. The fleet run is never SILENT —
170
+ \`landscape.service-isolated\` (a warning) means the element landed with no edge
171
+ anywhere in \`architecture/\` while \`services/$1/model.likec4\` declares calls across
172
+ its boundary — the map owes those edges. It goes quiet on the FIRST edge, so draw
173
+ every call the brief listed in one pass: nothing will name the ones you leave out.
174
+ A service whose model declares no such call and whose element
175
+ has no edge is SILENT here: \`landscape.touched: false\` in step 1's brief is the
176
+ only place that state is named, so read it before this run rather than hoping
177
+ for it in it.
178
+ Six warnings on this run are about the RENDERER's wiring rather than about any
179
+ document, and one command fixes four of them: \`service.model-excluded\` (the root
180
+ \`likec4.config.json\` excludes a directory holding a model that extends the map, so
181
+ the renderer never loads it), \`service.model-unexcluded\` (its mirror, and the most
182
+ damaging — a model that STANDS ALONE whose directory the root \`exclude\` does not
183
+ cover merges into the root project and duplicates every kind the map declares,
184
+ which blanks the whole project rather than one service),
185
+ \`service.likec4-config-stray\` (a project file beside an extending model, which
186
+ claims the model out of the root project),
187
+ \`service.likec4-config-missing\` (a model that stands alone with no project file of
188
+ its own) and, when the first four are clear, \`c4.fleet-project-invalid\` — every
189
+ document reads clean where loam grades it and the ONE project the renderer builds
190
+ out of the map plus every extending model does not parse, because something is
191
+ declared in two of them. The first four: run \`loam subsystem sync\` — it rewrites
192
+ the root \`exclude\`, writes the missing project file and DELETES the stray one. The
193
+ fifth is an authoring fix: the message names the file and line, and the answer is
194
+ to declare the tag or element once, in the map or in the single service that owns it.
195
+ A sixth reads the same list and is NOT one of sync's: \`landscape.excluded\` says the
196
+ root \`exclude\` covers \`architecture/landscape.likec4\` itself, so the renderer has no
197
+ map to draw at all and every extending model in the root project resolves against
198
+ nothing — delete or narrow that entry by hand, at the line the finding quotes. While
199
+ it stands, \`c4.fleet-project-invalid\` is not graded at all: that check reads the
200
+ renderer's project, so the one entry would come back once per model instead of once as
201
+ the cause. Fix it first, then re-run and read the fifth.
202
+ Done, stated once: step 4 clean when run from inside the service's own repo, this
203
+ run reporting no \`landscape.*\` finding, no \`service.*\` renderer warning and no
204
+ \`c4.fleet-project-invalid\`, and
205
+ step 1's brief re-run reporting \`landscape.touched: true\` — or, for a service that
206
+ truly makes and receives no call, a stated reason its element is edgeless.
207
+ The fleet run is never SILENT —
89
208
  \`sources.unverifiable-from-here\` (severity ok) appears per service as a
90
209
  confirmation, not work — so "keep going until validation is quiet" is the wrong
91
210
  loop; the two runs are the test.
@@ -1 +1 @@
1
- {"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../../../src/core/agent/workflows/adopt.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,kFAAkF;IACpF,YAAY,EAAE,cAAc;IAC5B,OAAO,EACL,iOAAiO;IACnO,UAAU,EAAE,iCAAiC;IAC7C,YAAY,EAAE,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE;QACL,+EAA+E;QAC/E,2IAA2I;QAC3I,gKAAgK;QAChK,iDAAiD;QACjD,kIAAkI;QAClI,yNAAyN;KAC1N;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHP;CACA,CAAC","sourcesContent":["import type { CommandContent } from \"../contract.js\";\n\n/** The adoption protocol: write one service's baseline docs from its code, as draft. */\nexport const LOAM_ADOPT: CommandContent = {\n name: \"loam-adopt\",\n description:\n \"Adopt a service — write its baseline docs from its code, as draft, then validate\",\n argumentHint: \"<service-id>\",\n purpose:\n \"Write one service's baseline documentation into the docs repo from its code, as `draft`. You read the code; loam states the work and checks the result — it never reads the service, so anything you cannot show, do not write.\",\n invocation: \"loam instructions loam-adopt $1\",\n placeholders: [\"service\"],\n spine: [\n \"wire this repo (`loam init`, then `loam doctor`) if it has no ./loam.json yet\",\n \"`loam adopt` — the brief: the order to read the service in, every file to write, the grammar of each, and what the fleet map already says\",\n \"walk the service in the brief's order — shape first, then one surface at a time — keeping the list of every path you open, because that list becomes `sources`\",\n \"write the artifacts, everything `status: draft`\",\n \"validate the service, then validate the whole fleet — a baseline that passes one and fails the other is documented and invisible\",\n \"hand back with what you could not determine from the code, which directories you never opened, the branch-to-scenario count per operation, and three behaviours your documents do not describe — then let a human vouch\",\n ],\n body: `Write one service's baseline documentation into the loam docs repo (its path is\n\\`docsDir\\` in ./loam.json). You read the code; loam states the work and checks the\nresult. It never reads the service — so anything you cannot show, do not write.\n\n**The bar this artifact set aims at is reproducibility**: a reader should be able\nto answer, from these files alone — what this boundary exposes, what it reaches,\nwhat shapes it exchanges, how it is run, and what pages whom — without opening\nthe code. \\`loam validate\\` grades form and joins, never depth: green means the\nfiles agree with each other, and the bar is what \"done\" is measured against — a\nthin baseline that validates is thin, not done.\n\n0. If there is no ./loam.json here, wire the repo first:\n \\`loam init --docs <path-to-docs-repo> --service $1\\` (add \\`--create\\` ONLY if the\n docs repo does not exist yet), then \\`loam doctor\\` — it resolves \\`docsDir\\`,\n checks the docs repo is one, and reports the service binding. Do not go on with\n \\`docs-missing\\`, \\`services-missing\\` or any \\`doctor.*\\` blocker standing.\n Every \\`doctor\\` finding carries a \\`fix\\` field spelling the exact command —\n type that, not an approximation of it.\n If this repo is already wired, \\`loam status --json\\` in the docs repo is the\n fastest way to see whether $1 is even the service that owes work next: its\n \\`next.adopt\\` entries name the services with nothing written down yet.\n1. \\`loam adopt --service $1 --json\\`. That output IS the brief:\n - \\`warnings[]\\` — read these FIRST. A near-miss against an existing service id\n usually means \\`$1\\` is a typo, and a brief followed to the letter then produces\n a complete, validating baseline for a service that does not exist.\n - \\`targets[]\\` — every file to write. \\`action: \"diff\"\\` means the file ALREADY EXISTS:\n read it, diff your findings against it, report what disagrees. Do not replace it.\n \\`action: \"edit\"\\` appears on exactly one target — \\`architecture/landscape.likec4\\`,\n the WHOLE FLEET's map: add this service's element and edges to it, never rewrite it.\n - \\`targets[].shape\\` — the grammar of each artifact, and \\`example\\` where one is\n shorter than a description. Every rule there is one a later check depends on;\n rules nothing checks are in \\`unchecked[]\\` instead, and are still worth following.\n - \\`landscape\\` — the elements and edges the fleet already has for this service.\n Bind to them; do not draw a second version of the same box. \\`landscape.expects\\`\n lists operations other services already call — your openapi.yaml owes them.\n \\`landscape.instruction\\` is the write the fleet map still owes this service; it\n is \\`null\\` once an element resolves to it, and only then.\n - \\`frontmatter\\` — what to put in the header of every markdown artifact.\n - \\`checks[]\\` — what \\`loam validate\\` will run. \\`unchecked[]\\` — what it will not.\n2. Read \\`AGENTS.md\\` at the docs repo root, then walk the service — \\`walk[]\\` in the\n same \\`adopt\\` output is the order, and it is an order, not a menu. Each stop\n names what to open, what to take from it, and which artifacts it feeds\n (\\`lands\\`). The first two stops fix what the service IS — how many processes,\n built from what — before any surface is enumerated: an agent that opens the\n HTTP routes first has already decided the service is an API by the time it\n meets the scheduler, and the consumer group and the outbox never get written\n down. Do not stop at the surface you recognise fastest.\n \\`walkClose\\` is the question that ends it: **list the directories you did not\n open.** Nothing downstream can find a service you documented a third of —\n \\`api.ungoverned\\` grades the operations you WROTE, and is silent about the twelve\n you never did.\n **Keep a list of every path you actually open.** That list becomes \\`sources\\` —\n written as files and directories, never glob patterns — and it is the only line\n tying the document to the repository. Never pad it with paths you did not read:\n it is a record, and \\`loam vouch\\` hashes exactly what it names.\n3. Write the artifacts under \\`services/$1/\\`, in the order the brief lists them, and\n make the landscape edit the brief asks for.\n Everything \\`status: draft\\`. Never write \\`last_verified\\`, \\`sources_digest\\`,\n \\`content_digest\\` or \\`sources_files\\`.\n4. \\`loam validate --service $1 --json\\`. Fix every error. \\`sources.unvouched\\` is\n expected on a fresh baseline — it closes when a person vouches, not when you do.\n \\`sources.unwalked\\` is the walk graded against the repository: its \\`details\\` name\n the top-level paths git tracks and \\`sources\\` never reached into. Treat each one\n as a place to go back to, not as a line to silence — the fix is reading it, or\n one sentence in step 6 saying why this document does not owe it.\n5. \\`loam validate --all --json\\` in the docs repo. This is the run that grades the\n fleet map: \\`landscape.service-unmodelled\\` means the element never landed,\n \\`landscape.binding-unknown\\` / \\`landscape.binding-duplicate\\` mean it landed wrong,\n and \\`landscape.missing\\` means there is no map at all. A baseline that passes step 4\n and fails this one is documented and invisible.\n Done, stated once: step 4 clean when run from inside the service's own repo, and\n this run reporting no \\`landscape.*\\` finding. The fleet run is never SILENT —\n \\`sources.unverifiable-from-here\\` (severity ok) appears per service as a\n confirmation, not work — so \"keep going until validation is quiet\" is the wrong\n loop; the two runs are the test.\n6. Hand back, and say seven things:\n - what you could not determine from the code;\n - what the existing artifacts disagreed with;\n - which parts you are least sure of;\n - what you did not open — every path \\`sources.unwalked\\` named, with one line\n each on why the baseline does not owe it. That list is the only account\n anybody gets of how much of the service was actually read; loam can name the\n paths, and it can never say whether skipping one was right;\n - **two counts per operation**: how many decisions its code makes — permission\n checks, conditionally required fields, defaults and normalisations, refused\n transitions — and how many scenarios you wrote for it.\n \\`12 branches / 3 scenarios\\` is a fact a reader can act on; \"the\n requirements look complete\" is not, and no check loam has can tell the two\n apart;\n - **how well this service is covered by its own tests**, and how many of them\n became scenarios. Say the number the service's own coverage tooling\n reports, and where you read it. This is the ceiling on the whole baseline:\n a well-covered service can be documented from evidence, and a service with\n almost no tests can only be documented from a reading of its code, which is\n a weaker document however carefully it is written. Nothing in loam can\n compute this — say it, or nobody ever knows which kind they are holding;\n - **three behaviours this service has that your documents do not describe.**\n Not \"is this enough\" — that question is answered yes by every agent that\n ever wrote a baseline, including the ones that documented a third of a\n service, because the only thing it can be answered against is the document\n itself. Name three. If you looked for three and found none, say exactly\n that: it is a claim a reviewer can go and check, which \"it is complete\"\n is not.\n Then a human runs \\`loam vouch --service $1\\` in the service's own repo.\n\nAn empty docs repo's \\`loam status --json\\` names this recipe's own states as its\nfirst-hour ladder: \\`next.author-landscape\\` (the fleet map is missing, or still the\nscaffold's untouched bytes — step 3's landscape edit is what discharges it),\n\\`next.bind-service\\` (no service repository is wired to the fleet yet — step 0) and\n\\`next.adopt-first\\` (services/ is empty — this protocol, from step 1). Landing on\none of those codes means: run this recipe, starting at the step it points at.\n\nWhere the code does not say, write that it does not say. A confident sentence about\nbehaviour nobody can find is the one failure mode none of loam's checks can catch.\n`,\n};\n"]}
1
+ {"version":3,"file":"adopt.js","sourceRoot":"","sources":["../../../../src/core/agent/workflows/adopt.ts"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,kFAAkF;IACpF,YAAY,EAAE,cAAc;IAC5B,OAAO,EACL,iOAAiO;IACnO,UAAU,EAAE,iCAAiC;IAC7C,YAAY,EAAE,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE;QACL,+EAA+E;QAC/E,2IAA2I;QAC3I,gKAAgK;QAChK,yKAAyK;QACzK,kIAAkI;QAClI,yNAAyN;KAC1N;IACD,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyOP;CACA,CAAC","sourcesContent":["import type { CommandContent } from \"../contract.js\";\n\n/** The adoption protocol: write one service's baseline docs from its code, as draft. */\nexport const LOAM_ADOPT: CommandContent = {\n name: \"loam-adopt\",\n description:\n \"Adopt a service — write its baseline docs from its code, as draft, then validate\",\n argumentHint: \"<service-id>\",\n purpose:\n \"Write one service's baseline documentation into the docs repo from its code, as `draft`. You read the code; loam states the work and checks the result — it never reads the service, so anything you cannot show, do not write.\",\n invocation: \"loam instructions loam-adopt $1\",\n placeholders: [\"service\"],\n spine: [\n \"wire this repo (`loam init`, then `loam doctor`) if it has no ./loam.json yet\",\n \"`loam adopt` — the brief: the order to read the service in, every file to write, the grammar of each, and what the fleet map already says\",\n \"walk the service in the brief's order — shape first, then one surface at a time — keeping the list of every path you open, because that list becomes `sources`\",\n \"write the artifacts, everything `status: draft` — the model EXTENDS the fleet map — then `loam subsystem sync` for the renderer wiring, which is loam's and never yours\",\n \"validate the service, then validate the whole fleet — a baseline that passes one and fails the other is documented and invisible\",\n \"hand back with what you could not determine from the code, which directories you never opened, the branch-to-scenario count per operation, and three behaviours your documents do not describe — then let a human vouch\",\n ],\n body: `Write one service's baseline documentation into the loam docs repo (its path is\n\\`docsDir\\` in ./loam.json). You read the code; loam states the work and checks the\nresult. It never reads the service — so anything you cannot show, do not write.\n\n**The bar this artifact set aims at is reproducibility**: a reader should be able\nto answer, from these files alone — what this boundary exposes, what it reaches,\nwhat shapes it exchanges, how it is run, and what pages whom — without opening\nthe code. \\`loam validate\\` grades form and joins, never depth: green means the\nfiles agree with each other, and the bar is what \"done\" is measured against — a\nthin baseline that validates is thin, not done.\n\n0. If there is no ./loam.json here, wire the repo first:\n \\`loam init --docs <path-to-docs-repo> --service $1\\` (add \\`--create\\` ONLY if the\n docs repo does not exist yet), then \\`loam doctor\\` — it resolves \\`docsDir\\`,\n checks the docs repo is one, and reports the service binding. Do not go on with\n \\`docs-missing\\`, \\`services-missing\\` or any \\`doctor.*\\` blocker standing.\n Every \\`doctor\\` finding carries a \\`fix\\` field spelling the exact command —\n type that, not an approximation of it.\n If this repo is already wired, \\`loam status --json\\` in the docs repo is the\n fastest way to see whether $1 is even the service that owes work next: its\n \\`next.adopt\\` entries name the services with nothing written down yet.\n1. \\`loam adopt --service $1 --json\\`. That output IS the brief:\n - \\`warnings[]\\` — read these FIRST. A near-miss against an existing service id\n usually means \\`$1\\` is a typo, and a brief followed to the letter then produces\n a complete, validating baseline for a service that does not exist.\n - \\`targets[]\\` — every file to write. \\`action: \"diff\"\\` means the file ALREADY EXISTS:\n read it, diff your findings against it, report what disagrees. Do not replace it.\n \\`action: \"edit\"\\` appears on exactly one target — \\`architecture/landscape.likec4\\`,\n the WHOLE FLEET's map: add this service's element and edges to it, never rewrite it.\n It appears while nothing resolves to the service AND while the element that does\n has no edge touching it; \\`targets[].shape\\` says which of the two you are in.\n It does NOT appear when loam could not READ the map (\\`landscape.modelled: null\\`\n — a broken landscape, or a broken sibling under \\`architecture/\\`): nothing is\n known about what the map already draws, so no write to the whole fleet's map is\n briefed. \\`landscape.instruction\\` carries the answer and names the documents that\n failed; fix those and re-run.\n - \\`targets[].shape\\` — the grammar of each artifact, and \\`example\\` where one is\n shorter than a description. Every rule there is one a later check depends on;\n rules nothing checks are in \\`unchecked[]\\` instead, and are still worth following.\n - \\`landscape\\` — the elements and edges the fleet already has for this service.\n Bind to them; do not draw a second version of the same box. \\`landscape.expects\\`\n lists operations other services already call — your openapi.yaml owes them.\n \\`landscape.instruction\\` is the write the fleet map still owes this service; it\n is \\`null\\` once an element resolves to it AND at least one edge ANYWHERE in the\n \\`architecture/\\` project touches that element (\\`landscape.touched\\`), and only\n then — one edge closes the state, so draw every call in one pass.\n \\`landscape.attested\\` lists the\n calls \\`services/$1/model.likec4\\` already declares across its boundary — those\n are the edges the map owes, collapsed to the service; an empty list on a\n service with no model is not licence to invent one, and the instruction says so.\n - \\`frontmatter\\` — what to put in the header of every markdown artifact.\n - \\`checks[]\\` — what \\`loam validate\\` will run. \\`unchecked[]\\` — what it will not.\n2. Read \\`AGENTS.md\\` at the docs repo root, then walk the service — \\`walk[]\\` in the\n same \\`adopt\\` output is the order, and it is an order, not a menu. Each stop\n names what to open, what to take from it, and which artifacts it feeds\n (\\`lands\\`). The first two stops fix what the service IS — how many processes,\n built from what — before any surface is enumerated: an agent that opens the\n HTTP routes first has already decided the service is an API by the time it\n meets the scheduler, and the consumer group and the outbox never get written\n down. Do not stop at the surface you recognise fastest.\n \\`walkClose\\` is the question that ends it: **list the directories you did not\n open.** Nothing downstream can find a service you documented a third of —\n \\`api.ungoverned\\` grades the operations you WROTE, and is silent about the twelve\n you never did.\n **Keep a list of every path you actually open.** That list becomes \\`sources\\` —\n written as files and directories, never glob patterns — and it is the only line\n tying the document to the repository. Never pad it with paths you did not read:\n it is a record, and \\`loam vouch\\` hashes exactly what it names.\n3. Write the artifacts under \\`services/$1/\\`, in the order the brief lists them, and\n make the landscape edit the brief asks for — the element where none resolves, the\n edges where the element stands alone, and the map's own housekeeping\n \\`unchecked[]\\` names: a placeholder tag to clear, a curated view to add the\n element to.\n **model.likec4 EXTENDS the fleet map.** It declares no \\`specification\\` block and\n no copy of anything the map already draws: its whole body is\n \\`model { extend <fqn> { …containers… } }\\`, where \\`<fqn>\\` is the FULLY-QUALIFIED\n id of the element bound to \\`services/$1/\\` (the brief's \\`landscape.elements\\` names\n it; \\`extend orderService\\` resolves to nothing when the id is\n \\`marketplace.orderService\\`). Kinds and tags come from\n \\`architecture/landscape.likec4\\` — a kind you need and the map does not declare\n (\\`element database\\`, \\`element queue\\`) is added THERE, once, in the same landscape\n edit. Cross-boundary edges are written OUTSIDE the extend block, from the container\n that makes the call to the other party's element as the map spells it; an element\n this file declares outside its own is \\`c4.element-unowned\\` (warn), and which fix\n applies depends on whose it is — a store or component this service OWNS belongs\n INSIDE the \\`extend\\` block (its id becomes \\`<fqn>.<name>\\`), a system the service\n merely reaches is declared in the map instead, and another service's internals\n belong in that service's model. If you are DIFFING an existing model\n that carries its own \\`specification\\`, leave it alone: that shape is still legal\n and still parsed on its own, and \\`c4.declaration-diverged\\` is what reports where\n its copies of the map's elements have drifted. Migrating one is the recipe in\n SCHEMA.md, \"Two shapes of a service model\" — not something to do inside an\n adoption you were not asked to widen.\n A flow behind one of your arch.spec.md requirements — a \\`dynamic view\\`\n over this service's own containers — goes in a \\`.likec4\\` beside model.likec4\n (\\`services/$1/usecases/<name>.likec4\\` by convention; \\`views.likec4\\` reads the\n same, because the renderer's per-service project reads every \\`.likec4\\` under the\n directory and so does loam), tagged \\`#req-<Requirement-ID>\\` of a requirement in\n this service's spec.md or arch.spec.md, with the tag declared in the map's\n \\`specification\\` block or in a tags-only \\`specification { tag req-… }\\` beside the\n \\`extend\\` — in exactly ONE of the two. Declared in both, the model's own project\n holds the tag twice: the error lands on whichever document carries the second\n declaration, as \\`c4.invalid\\` (an error, and the model's grading is suspended\n behind it) when that is model.likec4, or as \\`usecase.flow-invalid\\` when it is the\n sibling. Step 4 grades it. It never goes in \\`architecture/usecases/\\`,\n which cannot see your containers and turns the whole fleet \\`landscape.invalid\\`; a\n flow that crosses services goes there and is tagged \\`#cap-\\`. Never a \\`#cap-\\` tag\n beside a model. Then run \\`loam subsystem sync\\` (from\n this repo or the docs repo — it resolves \\`docsDir\\`): once the docs root carries\n the \\`likec4.config.json\\` step 0's doctor asks for, it keeps that file's\n \\`exclude\\` list covering exactly the service directories whose models stand alone —\n so an extending model stays inside the root project, where it is the only place it\n parses and where the renderer draws it beside the map — and writes\n \\`services/<…>/<id>/likec4.config.json\\` beside each STANDALONE model that has none.\n Both are loam's — never write one yourself, never list it in \\`sources\\`, never\n diff it, never hand-edit the root \\`exclude\\`'s \\`services/\\` entries — and \\`sync\\`\n leaves what it wrote untracked for you to commit. A repo whose models all extend\n the map usually has nothing for \\`sync\\` to write here, and that is the healthy\n state, not a skipped step.\n Everything \\`status: draft\\`. Never write \\`last_verified\\`, \\`sources_digest\\`,\n \\`content_digest\\` or \\`sources_files\\`.\n4. \\`loam validate --service $1 --json\\`. Fix every error. \\`c4.valid\\` reading\n \"extends the fleet map\" is the confirmation that the model was read as one\n document with the map; \\`c4.invalid\\` on this run means the model plus the map do\n not parse together, and every error is YOURS even where the message names\n \\`architecture/landscape.likec4\\` — the map parses clean on its own, or\n \\`spine.landscape-invalid\\` would say so instead and this model could not be read\n at all. \\`c4.element-unowned\\` (warn) is an element you declared outside the\n element you extend — nest it inside the \\`extend\\` block if this service owns it,\n declare it in the map if the service only reaches it. \\`sources.unvouched\\` is\n expected on a fresh baseline — it closes when a person vouches, not when you do.\n \\`sources.unwalked\\` is the walk graded against the repository: its \\`details\\` name\n the top-level paths git tracks and \\`sources\\` never reached into. Treat each one\n as a place to go back to, not as a line to silence — the fix is reading it, or\n one sentence in step 6 saying why this document does not owe it.\n \\`usecase.*\\` findings on this run are about the flows beside model.likec4:\n \\`usecase.step-unbacked\\` is a hop no relationship in model.likec4 backs,\n \\`usecase.step-contested\\` two edges backing one hop and naming different\n operations, \\`usecase.requirement-unresolved\\` a \\`#req-\\` tag naming no\n \\`Requirement-ID:\\` of this service's spec.md or arch.spec.md,\n \\`usecase.capability-unresolved\\` a \\`#cap-\\` tag beside a model (drop it — a\n capability is claimed on the fleet map, never inside one service), and\n \\`usecase.flow-invalid\\` a file beside the model that does not read — the flows\n were not graded, the model still was. \\`usecase.step-unlinked\\` never fires on a hop\n whose caller and provider resolve to the same service — a service owes no\n operationId to itself — but a hop from such a flow into another service's element\n (a stand-in model.likec4 declares for a sibling, with no \\`metadata { op }\\`) still\n warns here, exactly as it does on the fleet map.\n5. \\`loam validate --all --json\\` in the docs repo. This is the run that grades the\n fleet map: \\`landscape.service-unmodelled\\` means the element never landed,\n \\`landscape.binding-unknown\\` / \\`landscape.binding-duplicate\\` mean it landed wrong,\n and \\`landscape.missing\\` means there is no map at all. A baseline that passes step 4\n and fails this one is documented and invisible.\n \\`landscape.service-isolated\\` (a warning) means the element landed with no edge\n anywhere in \\`architecture/\\` while \\`services/$1/model.likec4\\` declares calls across\n its boundary — the map owes those edges. It goes quiet on the FIRST edge, so draw\n every call the brief listed in one pass: nothing will name the ones you leave out.\n A service whose model declares no such call and whose element\n has no edge is SILENT here: \\`landscape.touched: false\\` in step 1's brief is the\n only place that state is named, so read it before this run rather than hoping\n for it in it.\n Six warnings on this run are about the RENDERER's wiring rather than about any\n document, and one command fixes four of them: \\`service.model-excluded\\` (the root\n \\`likec4.config.json\\` excludes a directory holding a model that extends the map, so\n the renderer never loads it), \\`service.model-unexcluded\\` (its mirror, and the most\n damaging — a model that STANDS ALONE whose directory the root \\`exclude\\` does not\n cover merges into the root project and duplicates every kind the map declares,\n which blanks the whole project rather than one service),\n \\`service.likec4-config-stray\\` (a project file beside an extending model, which\n claims the model out of the root project),\n \\`service.likec4-config-missing\\` (a model that stands alone with no project file of\n its own) and, when the first four are clear, \\`c4.fleet-project-invalid\\` — every\n document reads clean where loam grades it and the ONE project the renderer builds\n out of the map plus every extending model does not parse, because something is\n declared in two of them. The first four: run \\`loam subsystem sync\\` — it rewrites\n the root \\`exclude\\`, writes the missing project file and DELETES the stray one. The\n fifth is an authoring fix: the message names the file and line, and the answer is\n to declare the tag or element once, in the map or in the single service that owns it.\n A sixth reads the same list and is NOT one of sync's: \\`landscape.excluded\\` says the\n root \\`exclude\\` covers \\`architecture/landscape.likec4\\` itself, so the renderer has no\n map to draw at all and every extending model in the root project resolves against\n nothing — delete or narrow that entry by hand, at the line the finding quotes. While\n it stands, \\`c4.fleet-project-invalid\\` is not graded at all: that check reads the\n renderer's project, so the one entry would come back once per model instead of once as\n the cause. Fix it first, then re-run and read the fifth.\n Done, stated once: step 4 clean when run from inside the service's own repo, this\n run reporting no \\`landscape.*\\` finding, no \\`service.*\\` renderer warning and no\n \\`c4.fleet-project-invalid\\`, and\n step 1's brief re-run reporting \\`landscape.touched: true\\` — or, for a service that\n truly makes and receives no call, a stated reason its element is edgeless.\n The fleet run is never SILENT —\n \\`sources.unverifiable-from-here\\` (severity ok) appears per service as a\n confirmation, not work — so \"keep going until validation is quiet\" is the wrong\n loop; the two runs are the test.\n6. Hand back, and say seven things:\n - what you could not determine from the code;\n - what the existing artifacts disagreed with;\n - which parts you are least sure of;\n - what you did not open — every path \\`sources.unwalked\\` named, with one line\n each on why the baseline does not owe it. That list is the only account\n anybody gets of how much of the service was actually read; loam can name the\n paths, and it can never say whether skipping one was right;\n - **two counts per operation**: how many decisions its code makes — permission\n checks, conditionally required fields, defaults and normalisations, refused\n transitions — and how many scenarios you wrote for it.\n \\`12 branches / 3 scenarios\\` is a fact a reader can act on; \"the\n requirements look complete\" is not, and no check loam has can tell the two\n apart;\n - **how well this service is covered by its own tests**, and how many of them\n became scenarios. Say the number the service's own coverage tooling\n reports, and where you read it. This is the ceiling on the whole baseline:\n a well-covered service can be documented from evidence, and a service with\n almost no tests can only be documented from a reading of its code, which is\n a weaker document however carefully it is written. Nothing in loam can\n compute this — say it, or nobody ever knows which kind they are holding;\n - **three behaviours this service has that your documents do not describe.**\n Not \"is this enough\" — that question is answered yes by every agent that\n ever wrote a baseline, including the ones that documented a third of a\n service, because the only thing it can be answered against is the document\n itself. Name three. If you looked for three and found none, say exactly\n that: it is a claim a reviewer can go and check, which \"it is complete\"\n is not.\n Then a human runs \\`loam vouch --service $1\\` in the service's own repo.\n\nAn empty docs repo's \\`loam status --json\\` names this recipe's own states as its\nfirst-hour ladder: \\`next.author-landscape\\` (the fleet map is missing, or still the\nscaffold's untouched bytes — step 3's landscape edit is what discharges it),\n\\`next.bind-service\\` (no service repository is wired to the fleet yet — step 0) and\n\\`next.adopt-first\\` (services/ is empty — this protocol, from step 1). Landing on\none of those codes means: run this recipe, starting at the step it points at.\n\nWhere the code does not say, write that it does not say. A confident sentence about\nbehaviour nobody can find is the one failure mode none of loam's checks can catch.\n`,\n};\n"]}