@warpgogol/werkstatt-shared 0.14.1 → 0.16.0

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 (451) hide show
  1. package/README.md +23 -15
  2. package/README.uk.md +1 -1
  3. package/package.json +534 -766
  4. package/src/{share/agent → agent}/api-catalog.ts +14 -1
  5. package/src/{share/agent → agent}/ard-catalog.ts +6 -1
  6. package/src/{share/agent → agent}/dns-aid.test.ts +2 -2
  7. package/src/agent/guidance.ts +52 -0
  8. package/src/agent/health.ts +68 -0
  9. package/src/{share/agent → agent}/index.ts +5 -1
  10. package/src/{share/agent → agent}/manifest.ts +83 -6
  11. package/src/{share/agent → agent}/openapi.ts +97 -4
  12. package/src/agent/receipt.ts +123 -0
  13. package/src/{share/agent → agent}/search.test.ts +3 -0
  14. package/src/{share/agent → agent}/search.ts +31 -5
  15. package/src/{share → agent}/tests/api-catalog.test.ts +8 -2
  16. package/src/{share → agent}/tests/ard-catalog.test.ts +11 -2
  17. package/src/{share → agent}/tests/capability.test.ts +1 -1
  18. package/src/{share → agent}/tests/fleet-catalog.test.ts +1 -1
  19. package/src/{share → agent}/tests/knowledge.test.ts +2 -2
  20. package/src/{share → agent}/tests/manifest.test.ts +72 -1
  21. package/src/{share → agent}/tests/mcp-card.test.ts +6 -2
  22. package/src/{share → agent}/tests/openapi.test.ts +119 -2
  23. package/src/{share → agent}/tests/proof.test.ts +1 -1
  24. package/src/{share → attribution}/material-credits.ts +4 -4
  25. package/src/{share → checks}/check-hints.ts +6 -1
  26. package/src/checks/index.ts +4 -1
  27. package/src/checks/lib/astro-site-url.ts +6 -1
  28. package/src/checks/lib/i18n.ts +14 -0
  29. package/src/checks/result-helpers.ts +2 -2
  30. package/src/checks/tests/remediation-auto-populate.test.ts +1 -1
  31. package/src/{share → client-scripts}/counter-utils.ts +6 -2
  32. package/src/{share/scripts → client-scripts}/external-link-qr.ts +11 -16
  33. package/src/{share/scripts → client-scripts}/external-links.ts +12 -1
  34. package/src/{share/scripts → client-scripts}/gsap-counter.ts +8 -3
  35. package/src/client-scripts/index.ts +35 -0
  36. package/src/{share/scripts → client-scripts}/inline-number-animation.ts +1 -1
  37. package/src/{share/scripts → client-scripts}/lenis.ts +6 -1
  38. package/src/{share/scripts → client-scripts}/lordicon.ts +6 -1
  39. package/src/{share/scripts → client-scripts}/orchestrator.ts +10 -1
  40. package/src/{share/scripts → client-scripts}/scheduler.ts +6 -1
  41. package/src/client-scripts/scroll-spy.ts +106 -0
  42. package/src/client-scripts/tests/orchestrator.test.ts +47 -0
  43. package/src/client-scripts/tests/scroll-spy.test.ts +204 -0
  44. package/src/{share/scripts → client-scripts/tests}/video-player.test.ts +51 -31
  45. package/src/component/contracts.ts +206 -0
  46. package/src/component/index.ts +13 -0
  47. package/src/{share → content}/content-reference.ts +3 -3
  48. package/src/{share/content → content}/entity-id.ts +6 -3
  49. package/src/content/index.ts +3 -0
  50. package/src/{share/content → content}/merge.ts +6 -1
  51. package/src/content/system-manifest.test.ts +107 -0
  52. package/src/content/system-manifest.ts +12 -94
  53. package/src/{share → content}/tests/resolve-field-path.test.ts +1 -1
  54. package/src/{share → content}/tests/substitute-deep.test.ts +1 -1
  55. package/src/content-discipline/index.ts +19 -0
  56. package/src/{share/content-discipline → content-discipline}/parsers.ts +2 -2
  57. package/src/{share/env.d.ts → env.d.ts} +6 -3
  58. package/src/fingerprint/canonical-json.ts +731 -0
  59. package/src/fingerprint/index.ts +14 -0
  60. package/src/fingerprint/primitives.ts +72 -0
  61. package/src/{share/i18n → i18n}/localization.ts +6 -2
  62. package/src/integration/adapters.ts +10 -71
  63. package/src/integration/dispatch.ts +1 -1
  64. package/src/integration/funnel.ts +6 -1
  65. package/src/integration/idempotency.ts +88 -0
  66. package/src/integration/index.ts +105 -4
  67. package/src/integration/lagebild-destination-adapter.ts +108 -0
  68. package/src/integration/lagebild-ingress.ts +7 -12
  69. package/src/integration/orchestration.ts +11 -10
  70. package/src/integration/tests/deliver-event.test.ts +1 -1
  71. package/src/integration/tests/dispatch.test.ts +4 -4
  72. package/src/integration/tests/hub-runtime.test.ts +22 -14
  73. package/src/integration/tests/idempotency.test.ts +81 -0
  74. package/src/integration/vitest.config.ts +1 -0
  75. package/src/kernel/desired-state.ts +227 -0
  76. package/src/kernel/diagnostic.ts +289 -0
  77. package/src/kernel/drift-guard.ts +166 -0
  78. package/src/kernel/fs-atomic.ts +131 -0
  79. package/src/kernel/index.ts +22 -0
  80. package/src/kernel/tests/drift-guard.test.ts +112 -0
  81. package/src/kernel/tests/fs-atomic.test.ts +150 -0
  82. package/src/kernel/tests/workpiece-env.test.ts +44 -0
  83. package/src/kernel/tests/workspace-io.test.ts +187 -0
  84. package/src/kernel/types.ts +518 -0
  85. package/src/kernel/workpiece-env.ts +48 -0
  86. package/src/kernel/workspace-io.ts +248 -0
  87. package/src/{share → knowledge}/tests/claim.test.ts +1 -1
  88. package/src/{share → knowledge}/tests/derivation.test.ts +1 -1
  89. package/src/{share → knowledge}/tests/freshness.test.ts +1 -1
  90. package/src/{share → knowledge}/tests/ledger.test.ts +1 -1
  91. package/src/{share → knowledge}/tests/plan.test.ts +1 -1
  92. package/src/{share → knowledge}/tests/source.test.ts +1 -1
  93. package/src/legal/index.ts +15 -0
  94. package/src/{share/middleware → middleware}/access-protection.ts +11 -8
  95. package/src/{share/middleware → middleware}/language-redirect.ts +3 -0
  96. package/src/{share → node}/dev-props-validator.ts +6 -1
  97. package/src/{share → node}/import-scan.ts +23 -3
  98. package/src/{share → node}/semantic/derived-prices-loader.ts +4 -2
  99. package/src/{share → node}/semantic/markdown-twin-provenance.ts +1 -1
  100. package/src/{share/semantic → node}/tests/derived-prices-loader.test.ts +14 -1
  101. package/src/{share/semantic → node}/tests/markdown-twin-provenance.test.ts +1 -1
  102. package/src/observability/env-resolver.ts +6 -1
  103. package/src/observability/index.ts +14 -1
  104. package/src/observability/otlp-converter.ts +6 -1
  105. package/src/observability/otlp-transport.ts +6 -1
  106. package/src/observability/pipeline-log.ts +81 -0
  107. package/src/observability/pusher.ts +6 -1
  108. package/src/observability/redact.ts +6 -1
  109. package/src/observability/typed-refs.ts +6 -2
  110. package/src/observability/vitest.config.ts +1 -0
  111. package/src/{share → offers}/formula-eval.ts +3 -3
  112. package/src/{share → offers}/tests/formula-eval.test.ts +2 -2
  113. package/src/onboarding/index.ts +1 -0
  114. package/src/{share → onboarding}/tests/onboarding-yaml.test.ts +1 -1
  115. package/src/ontology/archetype-registry.ts +6 -1
  116. package/src/ontology/archetypes/index.json +33 -1
  117. package/src/ontology/archetypes/index.yaml +27 -1
  118. package/src/ontology/archetypes/sections/entity-grid.yaml +46 -0
  119. package/src/ontology/archetypes/sections/exit-diagram.yaml +43 -0
  120. package/src/ontology/biome-token-projection.ts +6 -1
  121. package/src/ontology/capabilities/lead.prepare.yaml +44 -0
  122. package/src/ontology/capabilities/lead.submit.yaml +20 -3
  123. package/src/ontology/cosmic/index.ts +6 -1
  124. package/src/ontology/cosmic/moon-catalog.ts +6 -1
  125. package/src/ontology/cosmic/planet-catalog.ts +6 -1
  126. package/src/ontology/cosmic/star-catalog.ts +6 -1
  127. package/src/ontology/enums.ts +6 -1
  128. package/src/ontology/external-surfaces/index.ts +1 -1
  129. package/src/ontology/index.ts +6 -2
  130. package/src/ontology/manifest.ts +7 -4
  131. package/src/ontology/operations/artifact-store.ts +45 -0
  132. package/src/ontology/operations/dht.ts +98 -0
  133. package/src/ontology/operations/handoff.ts +92 -0
  134. package/src/ontology/operations/index.ts +193 -1
  135. package/src/ontology/operations/leitstand.ts +99 -0
  136. package/src/ontology/operations/materialization.ts +90 -0
  137. package/src/ontology/operations/mission.ts +111 -0
  138. package/src/ontology/operations/naming-policy.ts +132 -0
  139. package/src/ontology/operations/notausgang.ts +108 -0
  140. package/src/ontology/operations/release.ts +121 -0
  141. package/src/ontology/operations/sternsystem.ts +192 -0
  142. package/src/ontology/operations/werkstatt.ts +48 -0
  143. package/src/ontology/schemas/biome.ts +7 -2
  144. package/src/ontology/schemas/capability.ts +56 -4
  145. package/src/ontology/schemas/constellation.ts +6 -1
  146. package/src/ontology/schemas/index.ts +6 -2
  147. package/src/ontology/schemas/manifest-resolver.ts +6 -1
  148. package/src/ontology/schemas/page-entry.ts +9 -5
  149. package/src/ontology/schemas/system/growth.ts +6 -1
  150. package/src/ontology/schemas/system/manifest.ts +40 -1
  151. package/src/ontology/schemas/system/page-output.ts +7 -6
  152. package/src/ontology/schemas/system/text.ts +15 -0
  153. package/src/ontology/schemas/system.ts +6 -2
  154. package/src/ontology/shared-section-props/body-fragments.ts +2 -0
  155. package/src/ontology/tests/sternsystem-owner.test.ts +1 -1
  156. package/src/ontology/vitest.config.ts +1 -0
  157. package/src/{share → page}/page.ts +13 -9
  158. package/src/{share → page}/tests/dev-props-validator.test.ts +1 -1
  159. package/src/{share → page}/tests/hero-section-numbering-parity.test.ts +1 -1
  160. package/src/passport/claim-sign.ts +120 -0
  161. package/src/passport/index.ts +9 -1
  162. package/src/passport/key-rotate.ts +10 -2
  163. package/src/passport/schema.ts +6 -1
  164. package/src/passport/sign.ts +8 -3
  165. package/src/passport/vitest.config.ts +1 -0
  166. package/src/pbt/index.test.ts +95 -0
  167. package/src/pbt/index.ts +251 -0
  168. package/src/plugin/plugin-contract.ts +2 -2
  169. package/src/{share → policy}/entitlement.ts +24 -4
  170. package/src/{share → policy}/feature-policy.ts +8 -3
  171. package/src/{share → policy}/visibility.ts +7 -2
  172. package/src/redirects/redirects.ts +117 -0
  173. package/src/{share → redirects/tests}/redirects.test.ts +1 -1
  174. package/src/remediation/remediation-catalog.ts +316 -0
  175. package/src/{share/routes → routes}/template-filter.ts +1 -1
  176. package/src/{share → runtime}/runtime-context.ts +7 -2
  177. package/src/{share → runtime}/shared-context.ts +1 -1
  178. package/src/{share/schemas → schemas}/claims.ts +2 -2
  179. package/src/{share/schemas → schemas}/effects.ts +6 -1
  180. package/src/{share/schemas → schemas}/features.ts +1 -1
  181. package/src/{share/schemas → schemas}/index.ts +3 -3
  182. package/src/{share/schemas → schemas}/navigation.ts +6 -1
  183. package/src/{share/schemas → schemas}/page-base.ts +6 -2
  184. package/src/{share/schemas → schemas}/person.ts +1 -1
  185. package/src/{share/schemas → schemas}/standard-list-item.ts +1 -1
  186. package/src/{share → sections}/rfc0042-utils.ts +1 -1
  187. package/src/{share/semantic → semantic}/block-extractors/index.ts +20 -1
  188. package/src/{share/semantic → semantic}/business-projection.ts +95 -1
  189. package/src/semantic/canonical-uri.ts +74 -0
  190. package/src/{share/semantic → semantic}/extract.ts +100 -1
  191. package/src/semantic/fact-extraction.test.ts +47 -0
  192. package/src/semantic/fact-extraction.ts +46 -0
  193. package/src/semantic/freshness.ts +67 -0
  194. package/src/{share/semantic → semantic}/ids.ts +6 -1
  195. package/src/{share/semantic → semantic}/index.ts +9 -2
  196. package/src/{share/semantic → semantic}/jsonld/breadcrumb.ts +6 -2
  197. package/src/{share/semantic → semantic}/jsonld/context.ts +6 -2
  198. package/src/{share/semantic → semantic}/jsonld/faq.ts +6 -2
  199. package/src/{share/semantic → semantic}/jsonld/initiative.ts +6 -1
  200. package/src/{share/semantic → semantic}/jsonld/organization.ts +6 -1
  201. package/src/{share/semantic → semantic}/jsonld/person.ts +6 -2
  202. package/src/{share/semantic → semantic}/jsonld/service.ts +6 -2
  203. package/src/semantic/jsonld/shared.ts +36 -0
  204. package/src/semantic/jsonld/types.ts +24 -0
  205. package/src/{share/semantic → semantic}/jsonld/webpage.ts +6 -1
  206. package/src/semantic/jsonld/website.ts +32 -0
  207. package/src/{share/semantic → semantic}/jsonld.ts +6 -1
  208. package/src/{share/semantic → semantic}/llms.ts +51 -5
  209. package/src/{share/semantic → semantic}/models.ts +26 -38
  210. package/src/{share/semantic → semantic}/organization-profile.ts +3 -0
  211. package/src/{share/semantic → semantic}/page-builders/markdown-page.ts +6 -3
  212. package/src/{share/semantic → semantic}/page-utils.ts +6 -3
  213. package/src/{share/tests/breadcrumbs.test.ts → semantic/tests/breadcrumbs-0229.test.ts} +1 -1
  214. package/src/{share → semantic}/tests/build-page-price-markers.test.ts +2 -2
  215. package/src/{share/semantic → semantic}/tests/business-projection.test.ts +179 -0
  216. package/src/semantic/tests/canonical-uri.test.ts +68 -0
  217. package/src/{share/semantic → semantic}/tests/extract.test.ts +83 -0
  218. package/src/semantic/tests/freshness.pbt.test.ts +108 -0
  219. package/src/{share/tests/image-sitemap.test.ts → semantic/tests/image-sitemap-0150.test.ts} +1 -1
  220. package/src/{share → semantic}/tests/jsonld-service.test.ts +2 -2
  221. package/src/{share → semantic}/tests/jsonld-video.test.ts +3 -3
  222. package/src/{share → semantic}/tests/jsonld-webpage.test.ts +3 -3
  223. package/src/{share → semantic}/tests/llms-0789.test.ts +2 -2
  224. package/src/{share/semantic → semantic}/tests/llms.test.ts +46 -0
  225. package/src/{share → semantic}/tests/organization-jsonld.test.ts +3 -3
  226. package/src/{share/tests/output-projection.test.ts → semantic/tests/output-projection-0143.test.ts} +1 -1
  227. package/src/{share/tests/price-marker-resolver.test.ts → semantic/tests/price-marker-resolver-0767.test.ts} +2 -2
  228. package/src/{share/semantic → semantic}/tests/price-marker-resolver.test.ts +4 -2
  229. package/src/semantic/tests/project-claims.pbt.test.ts +60 -0
  230. package/src/{share/semantic → semantic}/tests/split-sentences.test.ts +1 -1
  231. package/src/{share → semantic}/tests/twin-path.test.ts +1 -1
  232. package/src/signing/index.ts +15 -0
  233. package/src/signing/key.ts +139 -0
  234. package/src/signing/sign.ts +66 -0
  235. package/src/signing/types.ts +29 -0
  236. package/src/{share/slug → slug}/slug-url.ts +4 -1
  237. package/src/stack/run-tool.ts +106 -0
  238. package/src/stack/stack-checks.ts +124 -0
  239. package/src/stack/tests/run-tool.test.ts +138 -0
  240. package/src/stack/tests/stack-checks.test.ts +141 -0
  241. package/src/stack/tests/walk-files.test.ts +131 -0
  242. package/src/stack/walk-files.ts +114 -0
  243. package/src/surface/blueprint.ts +342 -66
  244. package/src/surface/decision-composer.ts +6 -1
  245. package/src/surface/geo.ts +6 -1
  246. package/src/surface/index.ts +11 -7
  247. package/src/surface/types.ts +2 -2
  248. package/src/surface/vitest.config.ts +1 -0
  249. package/src/tests/signing-core.test.ts +129 -0
  250. package/src/{share → text}/css-value-normalize.ts +6 -1
  251. package/src/text/string-utils.ts +24 -0
  252. package/src/{share → text}/tests/text-normalize.test.ts +5 -0
  253. package/src/{share → text}/text-normalize.ts +4 -3
  254. package/src/{share → text}/wrap-inline-numbers.ts +1 -1
  255. package/src/types/axiom-study.d.ts +36 -0
  256. package/src/types/hls-js-light.d.ts +21 -0
  257. package/src/types/qrcode-browser.d.ts +23 -0
  258. package/src/typography/fix.pbt.test.ts +208 -0
  259. package/src/typography/fix.ts +148 -0
  260. package/src/typography/index.ts +54 -0
  261. package/src/typography/locale-defaults.ts +97 -0
  262. package/src/typography/rules-tier1.test.ts +459 -0
  263. package/src/typography/rules-tier1.ts +925 -0
  264. package/src/typography/rules-tier2-locale.pbt.test.ts +190 -0
  265. package/src/typography/rules-tier2-locale.test.ts +286 -0
  266. package/src/typography/rules-tier2-locale.ts +399 -0
  267. package/src/typography/rules-tier2-structure.test.ts +330 -0
  268. package/src/typography/rules-tier2-structure.ts +378 -0
  269. package/src/typography/rules-tier3-advisory.test.ts +290 -0
  270. package/src/typography/rules-tier3-advisory.ts +239 -0
  271. package/src/typography/text-surface.test.ts +244 -0
  272. package/src/typography/text-surface.ts +448 -0
  273. package/src/index.ts +0 -14
  274. package/src/integration/port-barrel.ts +0 -105
  275. package/src/share/agent/tests/api-catalog.test.ts +0 -8
  276. package/src/share/agent/tests/ard-catalog.test.ts +0 -8
  277. package/src/share/agent/tests/capability.test.ts +0 -14
  278. package/src/share/agent/tests/fleet-catalog.test.ts +0 -15
  279. package/src/share/agent/tests/knowledge.test.ts +0 -20
  280. package/src/share/agent/tests/manifest.test.ts +0 -9
  281. package/src/share/agent/tests/mcp-card.test.ts +0 -8
  282. package/src/share/agent/tests/openapi.test.ts +0 -8
  283. package/src/share/agent/tests/proof.test.ts +0 -15
  284. package/src/share/content/index.ts +0 -16
  285. package/src/share/content-discipline/index.ts +0 -14
  286. package/src/share/index.ts +0 -86
  287. package/src/share/knowledge/tests/claim.test.ts +0 -11
  288. package/src/share/knowledge/tests/derivation.test.ts +0 -30
  289. package/src/share/knowledge/tests/freshness.test.ts +0 -18
  290. package/src/share/knowledge/tests/ledger.test.ts +0 -35
  291. package/src/share/knowledge/tests/plan.test.ts +0 -19
  292. package/src/share/knowledge/tests/source.test.ts +0 -19
  293. package/src/share/legal/index.ts +0 -1
  294. package/src/share/redirects.ts +0 -54
  295. package/src/share/remediation/remediation-catalog.ts +0 -196
  296. package/src/share/scripts/index.ts +0 -26
  297. package/src/share/scripts/tests/orchestrator.test.ts +0 -8
  298. package/src/share/semantic/jsonld/shared.ts +0 -31
  299. package/src/share/semantic/jsonld/types.ts +0 -19
  300. package/src/share/semantic/jsonld/website.ts +0 -27
  301. package/src/share/string-utils.ts +0 -19
  302. package/src/share/types/axiom-study.d.ts +0 -22
  303. package/src/share/types/hls-js-light.d.ts +0 -16
  304. package/src/share/types/qrcode-browser.d.ts +0 -18
  305. package/src/share/utility-registry.yaml +0 -50
  306. package/src/share/vitest.config.ts +0 -8
  307. package/src/surface/blueprint-schema.ts +0 -314
  308. package/src/surface/blueprint-types.ts +0 -256
  309. /package/src/{share/agent → agent}/capability.ts +0 -0
  310. /package/src/{share/agent → agent}/dns-aid.ts +0 -0
  311. /package/src/{share/agent → agent}/fleet-catalog.ts +0 -0
  312. /package/src/{share/agent → agent}/knowledge.ts +0 -0
  313. /package/src/{share/agent → agent}/mcp-card.ts +0 -0
  314. /package/src/{share/agent → agent}/omit-empty.ts +0 -0
  315. /package/src/{share/agent → agent}/proof.ts +0 -0
  316. /package/src/{share/agent → agent}/tests/omit-empty.test.ts +0 -0
  317. /package/src/{share → attribution}/attribution-display.ts +0 -0
  318. /package/src/{share/scripts → client-scripts}/gsap-mountain-journey.ts +0 -0
  319. /package/src/{share/scripts → client-scripts}/gsap-parallax.ts +0 -0
  320. /package/src/{share/scripts → client-scripts}/gsap-reveal.ts +0 -0
  321. /package/src/{share/scripts → client-scripts}/gsap-stagger.ts +0 -0
  322. /package/src/{share/scripts → client-scripts}/live-photos.ts +0 -0
  323. /package/src/{share/scripts → client-scripts}/tests/external-link-qr.test.ts +0 -0
  324. /package/src/{share/scripts → client-scripts}/tests/external-links.test.ts +0 -0
  325. /package/src/{share/scripts → client-scripts}/tests/gsap-counter.test.ts +0 -0
  326. /package/src/{share/scripts → client-scripts}/tests/gsap-mountain-journey.test.ts +0 -0
  327. /package/src/{share/scripts → client-scripts}/tests/gsap-parallax.test.ts +0 -0
  328. /package/src/{share/scripts → client-scripts}/tests/gsap-reveal.test.ts +0 -0
  329. /package/src/{share/scripts → client-scripts}/tests/gsap-stagger.test.ts +0 -0
  330. /package/src/{share/scripts → client-scripts}/tests/inline-number-animation.test.ts +0 -0
  331. /package/src/{share/scripts → client-scripts}/tests/lenis.test.ts +0 -0
  332. /package/src/{share/scripts → client-scripts}/tests/live-photos.test.ts +0 -0
  333. /package/src/{share/scripts → client-scripts}/tests/lordicon.test.ts +0 -0
  334. /package/src/{share/scripts → client-scripts}/tests/scheduler.test.ts +0 -0
  335. /package/src/{share/scripts → client-scripts}/video-player.ts +0 -0
  336. /package/src/{share/content → content}/resolve-field-path.ts +0 -0
  337. /package/src/{share/content → content}/substitute-deep.ts +0 -0
  338. /package/src/{share → content}/tests/content-ref-index.test.ts +0 -0
  339. /package/src/{share/content-discipline → content-discipline}/types.ts +0 -0
  340. /package/src/{share → image-provider}/image-provider.ts +0 -0
  341. /package/src/{share/knowledge → knowledge}/claim.ts +0 -0
  342. /package/src/{share/knowledge → knowledge}/derivation.ts +0 -0
  343. /package/src/{share/knowledge → knowledge}/freshness.ts +0 -0
  344. /package/src/{share/knowledge → knowledge}/index.ts +0 -0
  345. /package/src/{share/knowledge → knowledge}/ledger.ts +0 -0
  346. /package/src/{share/knowledge → knowledge}/plan.ts +0 -0
  347. /package/src/{share/knowledge → knowledge}/source.ts +0 -0
  348. /package/src/{share/legal → legal}/translation-policy.ts +0 -0
  349. /package/src/{share/middleware → middleware}/tests/access-protection.test.ts +0 -0
  350. /package/src/{share → node}/fs/index.ts +0 -0
  351. /package/src/{share/tests/markdown-twin-provenance.test.ts → node/tests/markdown-twin-provenance-0613.test.ts} +0 -0
  352. /package/src/{share → offers}/offer-capacity.ts +0 -0
  353. /package/src/{share/onboarding-yaml/index.ts → onboarding/yaml.ts} +0 -0
  354. /package/src/{share → ontology}/tests/ontology-role-by-cosmic-name.test.ts +0 -0
  355. /package/src/{share/routes → routes}/tests/template-filter.test.ts +0 -0
  356. /package/src/{share/schemas → schemas}/claim-records.ts +0 -0
  357. /package/src/{share/schemas → schemas}/horizontal-align.ts +0 -0
  358. /package/src/{share/schemas → schemas}/icon-color.ts +0 -0
  359. /package/src/{share/schemas → schemas}/live-photo.ts +0 -0
  360. /package/src/{share/schemas → schemas}/material-credit.ts +0 -0
  361. /package/src/{share/schemas → schemas}/media.ts +0 -0
  362. /package/src/{share/schemas → schemas}/participant.ts +0 -0
  363. /package/src/{share/schemas → schemas}/print.ts +0 -0
  364. /package/src/{share/schemas → schemas}/section-background.ts +0 -0
  365. /package/src/{share/schemas → schemas}/section-body.ts +0 -0
  366. /package/src/{share/schemas → schemas}/section-cards.ts +0 -0
  367. /package/src/{share/schemas → schemas}/section-cta.ts +0 -0
  368. /package/src/{share/schemas → schemas}/section-header.ts +0 -0
  369. /package/src/{share/schemas → schemas}/section-image.ts +0 -0
  370. /package/src/{share/schemas → schemas}/section-motion.ts +0 -0
  371. /package/src/{share/schemas → schemas}/section-shell.ts +0 -0
  372. /package/src/{share/schemas → schemas}/section-stats.ts +0 -0
  373. /package/src/{share/schemas → schemas}/site-background.ts +0 -0
  374. /package/src/{share/schemas → schemas}/tests/claim-records.test.ts +0 -0
  375. /package/src/{share/schemas → schemas}/tests/claims.test.ts +0 -0
  376. /package/src/{share/schemas → schemas}/tests/effects.test.ts +0 -0
  377. /package/src/{share/schemas → schemas}/tests/features.test.ts +0 -0
  378. /package/src/{share/schemas → schemas}/tests/horizontal-align.test.ts +0 -0
  379. /package/src/{share/schemas → schemas}/tests/icon-color.test.ts +0 -0
  380. /package/src/{share/schemas → schemas}/tests/live-photo.test.ts +0 -0
  381. /package/src/{share/schemas → schemas}/tests/material-credit.test.ts +0 -0
  382. /package/src/{share/schemas → schemas}/tests/media.test.ts +0 -0
  383. /package/src/{share/schemas → schemas}/tests/navigation.test.ts +0 -0
  384. /package/src/{share/schemas → schemas}/tests/page-base.test.ts +0 -0
  385. /package/src/{share/schemas → schemas}/tests/participant.test.ts +0 -0
  386. /package/src/{share/schemas → schemas}/tests/person.test.ts +0 -0
  387. /package/src/{share/schemas → schemas}/tests/print.test.ts +0 -0
  388. /package/src/{share/schemas → schemas}/tests/section-background.test.ts +0 -0
  389. /package/src/{share/schemas → schemas}/tests/section-body.test.ts +0 -0
  390. /package/src/{share/schemas → schemas}/tests/section-cards.test.ts +0 -0
  391. /package/src/{share/schemas → schemas}/tests/section-cta.test.ts +0 -0
  392. /package/src/{share/schemas → schemas}/tests/section-header.test.ts +0 -0
  393. /package/src/{share/schemas → schemas}/tests/section-image.test.ts +0 -0
  394. /package/src/{share/schemas → schemas}/tests/section-motion.test.ts +0 -0
  395. /package/src/{share/schemas → schemas}/tests/section-shell.test.ts +0 -0
  396. /package/src/{share/schemas → schemas}/tests/section-stats.test.ts +0 -0
  397. /package/src/{share/schemas → schemas}/tests/site-background.test.ts +0 -0
  398. /package/src/{share/schemas → schemas}/tests/standard-list-item.test.ts +0 -0
  399. /package/src/{share/semantic → semantic}/ai.ts +0 -0
  400. /package/src/{share/semantic → semantic}/block-extraction.ts +0 -0
  401. /package/src/{share/semantic → semantic}/breadcrumbs.ts +0 -0
  402. /package/src/{share/semantic → semantic}/build-page.ts +0 -0
  403. /package/src/{share/semantic → semantic}/feed.ts +0 -0
  404. /package/src/{share/semantic → semantic}/image-sitemap.ts +0 -0
  405. /package/src/{share/semantic → semantic}/jsonld/article.ts +0 -0
  406. /package/src/{share/semantic → semantic}/jsonld/collection-list.ts +0 -0
  407. /package/src/{share/semantic → semantic}/jsonld/tests/article.test.ts +0 -0
  408. /package/src/{share/semantic → semantic}/jsonld/tests/breadcrumb.test.ts +0 -0
  409. /package/src/{share/semantic → semantic}/jsonld/tests/collection-list.test.ts +0 -0
  410. /package/src/{share/semantic → semantic}/jsonld/tests/faq.test.ts +0 -0
  411. /package/src/{share/semantic → semantic}/jsonld/tests/initiative.test.ts +0 -0
  412. /package/src/{share/semantic → semantic}/jsonld/tests/organization.test.ts +0 -0
  413. /package/src/{share/semantic → semantic}/jsonld/tests/person.test.ts +0 -0
  414. /package/src/{share/semantic → semantic}/jsonld/tests/service.test.ts +0 -0
  415. /package/src/{share/semantic → semantic}/jsonld/tests/shared.test.ts +0 -0
  416. /package/src/{share/semantic → semantic}/jsonld/tests/video.test.ts +0 -0
  417. /package/src/{share/semantic → semantic}/jsonld/tests/webpage.test.ts +0 -0
  418. /package/src/{share/semantic → semantic}/jsonld/tests/website.test.ts +0 -0
  419. /package/src/{share/semantic → semantic}/jsonld/video.ts +0 -0
  420. /package/src/{share/semantic → semantic}/llms-policy.ts +0 -0
  421. /package/src/{share/semantic → semantic}/markdown-hygiene.ts +0 -0
  422. /package/src/{share/semantic → semantic}/output-projection.ts +0 -0
  423. /package/src/{share/semantic → semantic}/page-markdown.ts +0 -0
  424. /package/src/{share/semantic → semantic}/price-marker-resolver.ts +0 -0
  425. /package/src/{share/semantic → semantic}/robots.ts +0 -0
  426. /package/src/{share/semantic → semantic}/tests/ai.test.ts +0 -0
  427. /package/src/{share/semantic → semantic}/tests/block-extraction.test.ts +0 -0
  428. /package/src/{share/semantic → semantic}/tests/breadcrumbs.test.ts +0 -0
  429. /package/src/{share/semantic → semantic}/tests/build-page.test.ts +0 -0
  430. /package/src/{share/semantic → semantic}/tests/feed.test.ts +0 -0
  431. /package/src/{share/semantic → semantic}/tests/helpers.ts +0 -0
  432. /package/src/{share/semantic → semantic}/tests/ids.test.ts +0 -0
  433. /package/src/{share/semantic → semantic}/tests/image-sitemap.test.ts +0 -0
  434. /package/src/{share/semantic → semantic}/tests/jsonld.test.ts +0 -0
  435. /package/src/{share/semantic → semantic}/tests/llms-policy.test.ts +0 -0
  436. /package/src/{share/semantic → semantic}/tests/markdown-hygiene.test.ts +0 -0
  437. /package/src/{share/semantic → semantic}/tests/markdown-page.test.ts +0 -0
  438. /package/src/{share/semantic → semantic}/tests/organization-profile.test.ts +0 -0
  439. /package/src/{share/semantic → semantic}/tests/output-projection.test.ts +0 -0
  440. /package/src/{share/semantic → semantic}/tests/page-markdown.test.ts +0 -0
  441. /package/src/{share/semantic → semantic}/tests/page-utils.test.ts +0 -0
  442. /package/src/{share/semantic → semantic}/tests/robots.test.ts +0 -0
  443. /package/src/{share/semantic → semantic}/tests/update-stamp.test.ts +0 -0
  444. /package/src/{share/semantic → semantic}/update-stamp.ts +0 -0
  445. /package/src/{share/slug → slug}/heading-slugger.ts +0 -0
  446. /package/src/{share/slug → slug}/index.ts +0 -0
  447. /package/src/{share/slug → slug}/slug-id.ts +0 -0
  448. /package/src/{share/slug → slug}/strategies.ts +0 -0
  449. /package/src/{share/slug → slug}/tests/slug.test.ts +0 -0
  450. /package/src/{share → text}/tests/text-normalize.pbt.test.ts +0 -0
  451. /package/src/{share → text}/text-position.ts +0 -0
@@ -14,7 +14,13 @@ no timestamps in the hash payload.
14
14
  </MODULE_CONTRACT>
15
15
  <CHANGE_SUMMARY>
16
16
  <item>RFC-0954: initial search manifest contract, query/response types, and pure builder.</item>
17
- <item>m000101: add NON_KNOWLEDGE_FILES and isNonKnowledgeFile for shared non-knowledge-file exclusion.</item>
17
+ <item>RFC-1097: step 6 — compass.migrate codemod run
18
+
19
+ Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
20
+ <item>RFC-1097: sweep — werkstatt-engine clean
21
+
22
+ Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
23
+ <item>RFC-1115: SearchChunk gains citation fields (title, canonicalUrl, updatedAt); SearchResult flattened to { title, canonicalUrl, updatedAt, lang, type, score, text }; SEARCH_MANIFEST_SCHEMA_VERSION "1" → "2".</item>
18
24
  </CHANGE_SUMMARY>
19
25
  */
20
26
 
@@ -39,8 +45,8 @@ export const SEARCH_DEFAULT_TOP_K = 5;
39
45
  /** Maximum character length for a chunk's `text` field (truncated before embedding). */
40
46
  export const SEARCH_CHUNK_TEXT_MAX_LENGTH = 2000;
41
47
 
42
- /** Schema version for the search manifest. */
43
- export const SEARCH_MANIFEST_SCHEMA_VERSION = "1";
48
+ /** Schema version for the search manifest. RFC-1115: "2" adds citation fields to chunks. */
49
+ export const SEARCH_MANIFEST_SCHEMA_VERSION = "2";
44
50
 
45
51
  /** Static asset path for the generated search manifest. */
46
52
  export const SEARCH_MANIFEST_PATH = "public/api/agent/v1/search-manifest.json";
@@ -81,6 +87,12 @@ export interface SearchChunk {
81
87
  heading: string | null;
82
88
  /** Body text extracted from the block, truncated to SEARCH_CHUNK_TEXT_MAX_LENGTH. */
83
89
  text: string;
90
+ /** RFC-1115: display title for citations (from heading; null when absent). */
91
+ title: string | null;
92
+ /** RFC-1115: absolute canonical URL (site origin + url) — citable without a follow-up fetch. */
93
+ canonicalUrl: string;
94
+ /** RFC-1115: source-backed update stamp YYYY-MM-DD (RFC-0317); null when unknown. */
95
+ updatedAt: string | null;
84
96
  }
85
97
 
86
98
  /** Static search manifest — build-time output written to public/api/agent/v1/search-manifest.json. */
@@ -112,11 +124,25 @@ export interface SearchQuery {
112
124
  topK?: number;
113
125
  }
114
126
 
115
- /** A single search result — chunk + similarity score. */
127
+ /**
128
+ * RFC-1115: a single search result — flattened citation shape.
129
+ * Carries everything an agent needs to cite without a follow-up fetch.
130
+ */
116
131
  export interface SearchResult {
117
- chunk: SearchChunk;
132
+ /** Display title (from chunk heading; null when absent). */
133
+ title: string | null;
134
+ /** Absolute canonical URL of the chunk's page or resource. */
135
+ canonicalUrl: string;
136
+ /** Source-backed update stamp YYYY-MM-DD (RFC-0317); null when unknown. */
137
+ updatedAt: string | null;
138
+ /** ISO 639-1 language code. */
139
+ lang: string;
140
+ /** Content type of the underlying chunk. */
141
+ type: SearchChunkType;
118
142
  /** Cosine similarity score (0..1, higher = more similar). */
119
143
  score: number;
144
+ /** Body text of the chunk. */
145
+ text: string;
120
146
  }
121
147
 
122
148
  /** Response from the search endpoint. */
@@ -8,15 +8,17 @@
8
8
  </MODULE_MAP>
9
9
  <CHANGE_SUMMARY>
10
10
  <item>RFC-0783: initial API Catalog projection tests.</item>
11
+ <item>RFC-1113: align agent discovery surface with RFC 9727 and MCP 2026-07-28 stateless era</item>
11
12
  </CHANGE_SUMMARY>
12
13
  */
13
14
 
14
15
  import { test, expect } from "vitest";
15
- import { buildApiCatalog } from "../agent/api-catalog.ts";
16
- import { buildAgentSurfaceManifest } from "../agent/manifest.ts";
16
+ import { buildApiCatalog } from "../api-catalog.ts";
17
+ import { buildAgentSurfaceManifest } from "../manifest.ts";
17
18
 
18
19
  test("buildApiCatalog: empty manifest yields service-meta + service-doc links", () => {
19
20
  const manifest = buildAgentSurfaceManifest({
21
+ generatedAt: "2026-01-01T00:00:00.000Z",
20
22
  site: "s",
21
23
  baseUrl: "https://s.example",
22
24
  languages: { default: "de", supported: ["de"] },
@@ -34,6 +36,7 @@ test("buildApiCatalog: empty manifest yields service-meta + service-doc links",
34
36
 
35
37
  test("buildApiCatalog: one knowledge ref → one item link", () => {
36
38
  const manifest = buildAgentSurfaceManifest({
39
+ generatedAt: "2026-01-01T00:00:00.000Z",
37
40
  site: "s",
38
41
  baseUrl: "https://s.example",
39
42
  languages: { default: "de", supported: ["de"] },
@@ -51,6 +54,7 @@ test("buildApiCatalog: one knowledge ref → one item link", () => {
51
54
 
52
55
  test("buildApiCatalog: mcp interface adds service-desc + service links", () => {
53
56
  const manifest = buildAgentSurfaceManifest({
57
+ generatedAt: "2026-01-01T00:00:00.000Z",
54
58
  site: "s",
55
59
  baseUrl: "https://s.example",
56
60
  languages: { default: "de", supported: ["de"] },
@@ -69,6 +73,7 @@ test("buildApiCatalog: determinism — same input produces identical output", ()
69
73
  site: "s",
70
74
  baseUrl: "https://s.example",
71
75
  languages: { default: "de", supported: ["de"] },
76
+ generatedAt: "2026-01-01T00:00:00.000Z",
72
77
  knowledge: [
73
78
  { domain: "offer", url: "/api/agent/v1/offer.json", schema: "gogol.agent.knowledge/offer@1" },
74
79
  { domain: "team", url: "/api/agent/v1/team.json", schema: "gogol.agent.knowledge/team@1" },
@@ -82,6 +87,7 @@ test("buildApiCatalog: determinism — same input produces identical output", ()
82
87
 
83
88
  test("buildApiCatalog: links are sorted by href within each relation", () => {
84
89
  const manifest = buildAgentSurfaceManifest({
90
+ generatedAt: "2026-01-01T00:00:00.000Z",
85
91
  site: "s",
86
92
  baseUrl: "https://s.example",
87
93
  languages: { default: "de", supported: ["de"] },
@@ -5,15 +5,17 @@
5
5
  </MODULE_CONTRACT>
6
6
  <CHANGE_SUMMARY>
7
7
  <item>Initial ARD ai-catalog.json projection tests.</item>
8
+ <item>RFC-1113: align agent discovery surface with RFC 9727 and MCP 2026-07-28 stateless era</item>
8
9
  </CHANGE_SUMMARY>
9
10
  */
10
11
 
11
12
  import { test, expect } from "vitest";
12
- import { buildArdCatalog } from "../agent/ard-catalog.ts";
13
- import { buildAgentSurfaceManifest } from "../agent/manifest.ts";
13
+ import { buildArdCatalog } from "../ard-catalog.ts";
14
+ import { buildAgentSurfaceManifest } from "../manifest.ts";
14
15
 
15
16
  test("buildArdCatalog: produces specVersion, host, and entries array", () => {
16
17
  const manifest = buildAgentSurfaceManifest({
18
+ generatedAt: "2026-01-01T00:00:00.000Z",
17
19
  site: "s",
18
20
  baseUrl: "https://s.example",
19
21
  languages: { default: "de", supported: ["de"] },
@@ -27,6 +29,7 @@ test("buildArdCatalog: produces specVersion, host, and entries array", () => {
27
29
 
28
30
  test("buildArdCatalog: each entry has identifier, displayName, type, url, representativeQueries", () => {
29
31
  const manifest = buildAgentSurfaceManifest({
32
+ generatedAt: "2026-01-01T00:00:00.000Z",
30
33
  site: "s",
31
34
  baseUrl: "https://s.example",
32
35
  languages: { default: "de", supported: ["de"] },
@@ -48,6 +51,7 @@ test("buildArdCatalog: each entry has identifier, displayName, type, url, repres
48
51
 
49
52
  test("buildArdCatalog: MCP interface adds MCP server entry", () => {
50
53
  const manifest = buildAgentSurfaceManifest({
54
+ generatedAt: "2026-01-01T00:00:00.000Z",
51
55
  site: "s",
52
56
  baseUrl: "https://s.example",
53
57
  languages: { default: "de", supported: ["de"] },
@@ -62,6 +66,7 @@ test("buildArdCatalog: MCP interface adds MCP server entry", () => {
62
66
 
63
67
  test("buildArdCatalog: knowledge refs produce entries", () => {
64
68
  const manifest = buildAgentSurfaceManifest({
69
+ generatedAt: "2026-01-01T00:00:00.000Z",
65
70
  site: "s",
66
71
  baseUrl: "https://s.example",
67
72
  languages: { default: "de", supported: ["de"] },
@@ -78,6 +83,7 @@ test("buildArdCatalog: knowledge refs produce entries", () => {
78
83
 
79
84
  test("buildArdCatalog: entries are sorted by identifier", () => {
80
85
  const manifest = buildAgentSurfaceManifest({
86
+ generatedAt: "2026-01-01T00:00:00.000Z",
81
87
  site: "s",
82
88
  baseUrl: "https://s.example",
83
89
  languages: { default: "de", supported: ["de"] },
@@ -97,6 +103,7 @@ test("buildArdCatalog: determinism — same input produces identical output", ()
97
103
  site: "s",
98
104
  baseUrl: "https://s.example",
99
105
  languages: { default: "de", supported: ["de"] },
106
+ generatedAt: "2026-01-01T00:00:00.000Z",
100
107
  knowledge: [
101
108
  { domain: "offer", url: "/api/agent/v1/offer.json", schema: "gogol.agent.knowledge/offer@1" },
102
109
  ],
@@ -109,6 +116,7 @@ test("buildArdCatalog: determinism — same input produces identical output", ()
109
116
 
110
117
  test("buildArdCatalog: host identifier uses did:web format with domain", () => {
111
118
  const manifest = buildAgentSurfaceManifest({
119
+ generatedAt: "2026-01-01T00:00:00.000Z",
112
120
  site: "warpgogol-com",
113
121
  baseUrl: "https://warpgogol.com",
114
122
  languages: { default: "de", supported: ["de"] },
@@ -120,6 +128,7 @@ test("buildArdCatalog: host identifier uses did:web format with domain", () => {
120
128
 
121
129
  test("buildArdCatalog: default hostDisplayName falls back to site name", () => {
122
130
  const manifest = buildAgentSurfaceManifest({
131
+ generatedAt: "2026-01-01T00:00:00.000Z",
123
132
  site: "my-site",
124
133
  baseUrl: "https://example.com",
125
134
  languages: { default: "de", supported: ["de"] },
@@ -16,7 +16,7 @@ import {
16
16
  resolveActiveCapabilities,
17
17
  capabilityToActionRef,
18
18
  type CapabilityRecord,
19
- } from "../agent/capability.ts";
19
+ } from "../capability.ts";
20
20
 
21
21
  function makeCap(overrides: Partial<CapabilityRecord> = {}): CapabilityRecord {
22
22
  return {
@@ -16,7 +16,7 @@ import {
16
16
  buildFleetAgentCatalog,
17
17
  computeFleetCatalogContentHash,
18
18
  FLEET_AGENT_CATALOG_SCHEMA,
19
- } from "../agent/fleet-catalog.ts";
19
+ } from "../fleet-catalog.ts";
20
20
 
21
21
  const sampleDoc = {
22
22
  surfaceVersion: "1.0.0",
@@ -16,8 +16,8 @@ import {
16
16
  AGENT_KNOWLEDGE_DOMAINS,
17
17
  isAgentKnowledgeDomain,
18
18
  formatAgentKnowledge,
19
- } from "../agent/knowledge.ts";
20
- import { BUSINESS_DOMAIN_VISIBILITY } from "../semantic/business-projection.ts";
19
+ } from "../knowledge.ts";
20
+ import { BUSINESS_DOMAIN_VISIBILITY } from "../../semantic/business-projection.ts";
21
21
 
22
22
  test("AGENT_KNOWLEDGE_DOMAINS: matches exactly the `public` BUSINESS_DOMAIN_VISIBILITY keys", () => {
23
23
  const publicDomains = Object.entries(BUSINESS_DOMAIN_VISIBILITY)
@@ -9,22 +9,27 @@
9
9
  <CHANGE_SUMMARY>
10
10
  <item>RFC-0286: initial builder tests.</item>
11
11
  <item>RFC-0954: add search interface tests.</item>
12
+ <item>RFC-1113: align agent discovery surface with RFC 9727 and MCP 2026-07-28 stateless era</item>
13
+ <item>RFC-1114: add a2a interface + supportedProtocols tests (AC-5).</item>
14
+ <item>RFC-1114: minimal real A2A endpoint + honest agent card</item>
12
15
  </CHANGE_SUMMARY>
13
16
  */
14
17
 
15
18
  import { test, expect } from "vitest";
16
19
  import {
20
+ AGENT_SURFACE_SCHEMA_ID,
17
21
  AGENT_SURFACE_VERSION,
18
22
  buildAgentSurfaceManifest,
19
23
  computeAgentManifestContentHash,
20
24
  computeSignedContentHash,
21
25
  canonicalJson,
22
- } from "../agent/manifest.ts";
26
+ } from "../manifest.ts";
23
27
 
24
28
  const baseInput = {
25
29
  site: "warpgogol-com",
26
30
  baseUrl: "https://warpgogol.com/",
27
31
  languages: { default: "de", supported: ["uk", "de"] },
32
+ generatedAt: "2026-01-01T00:00:00.000Z",
28
33
  };
29
34
 
30
35
  test("buildAgentSurfaceManifest: strips trailing slash and sorts supported languages", () => {
@@ -39,6 +44,7 @@ test("buildAgentSurfaceManifest: safe default — empty knowledge/actions, null
39
44
  expect(m.actions).toEqual([]);
40
45
  expect(m.interfaces.openapi).toBe(null);
41
46
  expect(m.interfaces.mcp).toBe(null);
47
+ expect(m.interfaces.a2a).toBe(null);
42
48
  expect(m.interfaces.twins).toBe(null);
43
49
  expect(m.interfaces.search).toBe(null);
44
50
  expect(m.proof).toBe(null);
@@ -149,3 +155,68 @@ test("computeSignedContentHash: matches computeAgentManifestContentHash for same
149
155
  const doc = { a: 1, b: 2, contentHash: "x", proof: null };
150
156
  expect(computeSignedContentHash(doc)).toBe(computeAgentManifestContentHash(doc));
151
157
  });
158
+
159
+ // ---------------------------------------------------------------------------
160
+ // RFC-1113: discovery metadata fields
161
+ // ---------------------------------------------------------------------------
162
+
163
+ test("buildAgentSurfaceManifest: emits $schema, generatedAt, supportedProtocols", () => {
164
+ const m = buildAgentSurfaceManifest(baseInput);
165
+ expect(m.$schema).toBe(AGENT_SURFACE_SCHEMA_ID);
166
+ expect(m.generatedAt).toBe("2026-01-01T00:00:00.000Z");
167
+ // Unconditional discovery artifacts only — no interfaces were provided.
168
+ expect(m.supportedProtocols).toEqual(["agent-skills", "ard", "dns-aid", "linkset", "llms"]);
169
+ });
170
+
171
+ test("buildAgentSurfaceManifest: supportedProtocols follows emitted interfaces", () => {
172
+ const m = buildAgentSurfaceManifest({
173
+ ...baseInput,
174
+ hasTwins: true,
175
+ openapiUrl: "/.well-known/agent.openapi.json",
176
+ mcp: { url: "/api/agent/mcp", protocolVersion: "2026-07-28" },
177
+ search: { url: "/api/agent/search", model: "@cf/baai/bge-m3", dimensions: 1024 },
178
+ });
179
+ expect(m.supportedProtocols).toEqual([
180
+ "agent-skills",
181
+ "ard",
182
+ "dns-aid",
183
+ "linkset",
184
+ "llms",
185
+ "mcp",
186
+ "openapi",
187
+ "search",
188
+ "twins",
189
+ ]);
190
+ });
191
+
192
+ // ---------------------------------------------------------------------------
193
+ // RFC-1114: a2a interface (AC-5)
194
+ // ---------------------------------------------------------------------------
195
+
196
+ test("buildAgentSurfaceManifest: populates interfaces.a2a and lists a2a in supportedProtocols", () => {
197
+ const m = buildAgentSurfaceManifest({
198
+ ...baseInput,
199
+ a2a: { url: "/api/agent/a2a", protocolVersion: "1.0" },
200
+ });
201
+ expect(m.interfaces.a2a).toEqual({ url: "/api/agent/a2a", protocolVersion: "1.0" });
202
+ expect(m.supportedProtocols).toContain("a2a");
203
+ });
204
+
205
+ test("buildAgentSurfaceManifest: a2a absent from supportedProtocols when no a2a interface", () => {
206
+ const m = buildAgentSurfaceManifest(baseInput);
207
+ expect(m.interfaces.a2a).toBe(null);
208
+ expect(m.supportedProtocols).not.toContain("a2a");
209
+ });
210
+
211
+ test("buildAgentSurfaceManifest: generatedAt does not change contentHash (AC-3)", () => {
212
+ const a = buildAgentSurfaceManifest(baseInput);
213
+ const b = buildAgentSurfaceManifest({ ...baseInput, generatedAt: "2026-12-31T23:59:59.000Z" });
214
+ expect(a.contentHash).toBe(b.contentHash);
215
+ expect(a.generatedAt).not.toBe(b.generatedAt);
216
+ });
217
+
218
+ test("computeAgentManifestContentHash: excludes generatedAt", () => {
219
+ const doc = { a: 1, generatedAt: "2026-01-01T00:00:00Z" };
220
+ const other = { a: 1, generatedAt: "2026-06-06T06:06:06Z" };
221
+ expect(computeAgentManifestContentHash(doc)).toBe(computeAgentManifestContentHash(other));
222
+ });
@@ -8,15 +8,17 @@
8
8
  </MODULE_MAP>
9
9
  <CHANGE_SUMMARY>
10
10
  <item>RFC-0783: initial MCP Server Card projection tests.</item>
11
+ <item>RFC-1113: align agent discovery surface with RFC 9727 and MCP 2026-07-28 stateless era</item>
11
12
  </CHANGE_SUMMARY>
12
13
  */
13
14
 
14
15
  import { test, expect } from "vitest";
15
- import { buildMcpServerCard } from "../agent/mcp-card.ts";
16
- import { buildAgentSurfaceManifest } from "../agent/manifest.ts";
16
+ import { buildMcpServerCard } from "../mcp-card.ts";
17
+ import { buildAgentSurfaceManifest } from "../manifest.ts";
17
18
 
18
19
  test("buildMcpServerCard: null mcp → returns null", () => {
19
20
  const manifest = buildAgentSurfaceManifest({
21
+ generatedAt: "2026-01-01T00:00:00.000Z",
20
22
  site: "s",
21
23
  baseUrl: "https://s.example",
22
24
  languages: { default: "de", supported: ["de"] },
@@ -26,6 +28,7 @@ test("buildMcpServerCard: null mcp → returns null", () => {
26
28
 
27
29
  test("buildMcpServerCard: mcp interface → card with correct fields", () => {
28
30
  const manifest = buildAgentSurfaceManifest({
31
+ generatedAt: "2026-01-01T00:00:00.000Z",
29
32
  site: "warpgogol",
30
33
  baseUrl: "https://warpgogol.com",
31
34
  languages: { default: "de", supported: ["de"] },
@@ -49,6 +52,7 @@ test("buildMcpServerCard: determinism — same input produces identical output",
49
52
  site: "s",
50
53
  baseUrl: "https://s.example",
51
54
  languages: { default: "de", supported: ["de"] },
55
+ generatedAt: "2026-01-01T00:00:00.000Z",
52
56
  mcp: { url: "/api/agent/mcp", protocolVersion: "2025-06-18" },
53
57
  };
54
58
  const a = buildMcpServerCard(buildAgentSurfaceManifest(input));
@@ -9,15 +9,17 @@
9
9
  <CHANGE_SUMMARY>
10
10
  <item>RFC-0289: initial OpenAPI formatter tests.</item>
11
11
  <item>RFC-0954: add search path projection tests.</item>
12
+ <item>RFC-1113: align agent discovery surface with RFC 9727 and MCP 2026-07-28 stateless era</item>
12
13
  </CHANGE_SUMMARY>
13
14
  */
14
15
 
15
16
  import { test, expect } from "vitest";
16
- import { formatAgentOpenApi } from "../agent/openapi.ts";
17
- import { buildAgentSurfaceManifest } from "../agent/manifest.ts";
17
+ import { formatAgentOpenApi } from "../openapi.ts";
18
+ import { buildAgentSurfaceManifest } from "../manifest.ts";
18
19
 
19
20
  test("formatAgentOpenApi: empty manifest yields a valid document with no paths", () => {
20
21
  const manifest = buildAgentSurfaceManifest({
22
+ generatedAt: "2026-01-01T00:00:00.000Z",
21
23
  site: "s",
22
24
  baseUrl: "https://s.example",
23
25
  languages: { default: "de", supported: ["de"] },
@@ -33,6 +35,7 @@ test("formatAgentOpenApi: empty manifest yields a valid document with no paths",
33
35
 
34
36
  test("formatAgentOpenApi: one knowledge ref → one GET path + one component schema", () => {
35
37
  const manifest = buildAgentSurfaceManifest({
38
+ generatedAt: "2026-01-01T00:00:00.000Z",
36
39
  site: "s",
37
40
  baseUrl: "https://s.example",
38
41
  languages: { default: "de", supported: ["de"] },
@@ -61,6 +64,7 @@ test("formatAgentOpenApi: one action ref → one POST path with verbatim input/o
61
64
  properties: { accepted: { type: "boolean" as const } },
62
65
  };
63
66
  const manifest = buildAgentSurfaceManifest({
67
+ generatedAt: "2026-01-01T00:00:00.000Z",
64
68
  site: "s",
65
69
  baseUrl: "https://s.example",
66
70
  languages: { default: "de", supported: ["de"] },
@@ -84,10 +88,25 @@ test("formatAgentOpenApi: one action ref → one POST path with verbatim input/o
84
88
  expect(doc.components.schemas["lead.submit-input"]).toEqual(inputSchema);
85
89
  expect(doc.components.schemas["lead.submit-output"]).toEqual(outputSchema);
86
90
  expect(op!.requestBody!.content["application/json"].schema).toEqual(inputSchema);
91
+
92
+ // RFC-1112: Idempotency-Key header parameter.
93
+ const idemParam = op!.parameters!.find((p) => p.name === "Idempotency-Key");
94
+ expect(idemParam).toBeTruthy();
95
+ expect(idemParam!.in).toBe("header");
96
+ expect(idemParam!.required).toBe(false);
97
+
98
+ // RFC-1112: problem+json error responses + shared problem-details schema.
99
+ expect(doc.components.schemas["problem-details"]).toBeTruthy();
100
+ for (const status of ["400", "409", "413", "422", "429", "502"]) {
101
+ const res = op!.responses[status];
102
+ expect(res, `missing ${status} response`).toBeTruthy();
103
+ expect(res!.content?.["application/problem+json"]).toBeTruthy();
104
+ }
87
105
  });
88
106
 
89
107
  test("formatAgentOpenApi: an action ref without a matching capability schema is skipped defensively", () => {
90
108
  const manifest = buildAgentSurfaceManifest({
109
+ generatedAt: "2026-01-01T00:00:00.000Z",
91
110
  site: "s",
92
111
  baseUrl: "https://s.example",
93
112
  languages: { default: "de", supported: ["de"] },
@@ -107,6 +126,7 @@ test("formatAgentOpenApi: an action ref without a matching capability schema is
107
126
 
108
127
  test("formatAgentOpenApi: mcp interface present → x-gogol-mcp is set", () => {
109
128
  const manifest = buildAgentSurfaceManifest({
129
+ generatedAt: "2026-01-01T00:00:00.000Z",
110
130
  site: "s",
111
131
  baseUrl: "https://s.example",
112
132
  languages: { default: "de", supported: ["de"] },
@@ -118,6 +138,7 @@ test("formatAgentOpenApi: mcp interface present → x-gogol-mcp is set", () => {
118
138
 
119
139
  test("formatAgentOpenApi: search interface present → /api/agent/search GET path with dynamic lang enum", () => {
120
140
  const manifest = buildAgentSurfaceManifest({
141
+ generatedAt: "2026-01-01T00:00:00.000Z",
121
142
  site: "s",
122
143
  baseUrl: "https://s.example",
123
144
  languages: { default: "de", supported: ["de", "uk"] },
@@ -136,6 +157,7 @@ test("formatAgentOpenApi: search interface present → /api/agent/search GET pat
136
157
 
137
158
  test("formatAgentOpenApi: search interface absent → no search path", () => {
138
159
  const manifest = buildAgentSurfaceManifest({
160
+ generatedAt: "2026-01-01T00:00:00.000Z",
139
161
  site: "s",
140
162
  baseUrl: "https://s.example",
141
163
  languages: { default: "de", supported: ["de"] },
@@ -144,3 +166,98 @@ test("formatAgentOpenApi: search interface absent → no search path", () => {
144
166
  expect(doc.paths["/api/agent/search"]).toBe(undefined);
145
167
  expect(doc.components.schemas["search-response"]).toBe(undefined);
146
168
  });
169
+
170
+ test("formatAgentOpenApi: agentGuidance renders into the operation description (RFC-1115 AC-4)", () => {
171
+ const manifest = buildAgentSurfaceManifest({
172
+ generatedAt: "2026-01-01T00:00:00.000Z",
173
+ site: "s",
174
+ baseUrl: "https://s.example",
175
+ languages: { default: "de", supported: ["de"] },
176
+ actions: [
177
+ {
178
+ id: "lead.submit",
179
+ url: "/api/agent/actions/lead.submit",
180
+ title: { de: "Anfrage senden" },
181
+ inputSchemaRef: "#/components/schemas/lead.submit-input",
182
+ entitlement: "agent.actions",
183
+ },
184
+ ],
185
+ });
186
+ const doc = formatAgentOpenApi(manifest, [
187
+ {
188
+ id: "lead.submit",
189
+ input: { type: "object" },
190
+ output: { type: "object" },
191
+ description: { de: "Reicht eine Kontaktanfrage ein." },
192
+ agentGuidance: {
193
+ sideEffect: "write",
194
+ whenToUse: "ein Besucher das Gewerbe kontaktieren will.",
195
+ whenNotToUse: "die Antwort bereits auf der Seite steht.",
196
+ retrySemantics: "mit demselben Idempotency-Key sicher wiederholbar.",
197
+ },
198
+ },
199
+ ]);
200
+ const op = doc.paths["/api/agent/actions/lead.submit"]?.post;
201
+ expect(op).toBeTruthy();
202
+ expect(op!.description).toContain("Reicht eine Kontaktanfrage ein.");
203
+ expect(op!.description).toContain("Use this when ein Besucher das Gewerbe kontaktieren will.");
204
+ expect(op!.description).toContain("Do not use this when die Antwort bereits auf der Seite steht.");
205
+ expect(op!.description).toContain("side effects");
206
+ expect(op!.description).toContain(
207
+ "Retry semantics: mit demselben Idempotency-Key sicher wiederholbar.",
208
+ );
209
+ });
210
+
211
+ test("formatAgentOpenApi: absent agentGuidance falls back to the base description (RFC-1115 AC-5)", () => {
212
+ const manifest = buildAgentSurfaceManifest({
213
+ generatedAt: "2026-01-01T00:00:00.000Z",
214
+ site: "s",
215
+ baseUrl: "https://s.example",
216
+ languages: { default: "de", supported: ["de"] },
217
+ actions: [
218
+ {
219
+ id: "lead.submit",
220
+ url: "/api/agent/actions/lead.submit",
221
+ title: { de: "Anfrage senden" },
222
+ inputSchemaRef: "#/components/schemas/lead.submit-input",
223
+ entitlement: "agent.actions",
224
+ },
225
+ ],
226
+ });
227
+ const doc = formatAgentOpenApi(manifest, [
228
+ {
229
+ id: "lead.submit",
230
+ input: { type: "object" },
231
+ output: { type: "object" },
232
+ description: { de: "Reicht eine Kontaktanfrage ein." },
233
+ },
234
+ ]);
235
+ const op = doc.paths["/api/agent/actions/lead.submit"]?.post;
236
+ expect(op!.description).toBe("Reicht eine Kontaktanfrage ein.");
237
+ });
238
+
239
+ test("formatAgentOpenApi: search-response schema matches the flattened citation shape (RFC-1115 AC-1)", () => {
240
+ const manifest = buildAgentSurfaceManifest({
241
+ generatedAt: "2026-01-01T00:00:00.000Z",
242
+ site: "s",
243
+ baseUrl: "https://s.example",
244
+ languages: { default: "de", supported: ["de"] },
245
+ search: { url: "/api/agent/search", model: "@cf/baai/bge-m3", dimensions: 1024 },
246
+ });
247
+ const doc = formatAgentOpenApi(manifest, []);
248
+ const schema = doc.components.schemas["search-response"] as {
249
+ properties: { results: { items: { required: string[]; properties: Record<string, unknown> } } };
250
+ };
251
+ const item = schema.properties.results.items;
252
+ expect(item.required).toEqual([
253
+ "title",
254
+ "canonicalUrl",
255
+ "updatedAt",
256
+ "lang",
257
+ "type",
258
+ "score",
259
+ "text",
260
+ ]);
261
+ expect(item.properties.canonicalUrl).toEqual({ type: "string" });
262
+ expect(item.properties.chunk).toBeUndefined();
263
+ });
@@ -16,7 +16,7 @@ import {
16
16
  buildAgentSigningPayload,
17
17
  AGENT_PROOF_DOMAIN,
18
18
  type AgentProofArtifactKind,
19
- } from "../agent/proof.ts";
19
+ } from "../proof.ts";
20
20
 
21
21
  function decodePayload(bytes: Uint8Array): string {
22
22
  return new TextDecoder().decode(bytes);
@@ -25,19 +25,19 @@ import {
25
25
  materialCreditSchema,
26
26
  materialTargetKey,
27
27
  formatMaterialCreditLine,
28
- } from "./schemas/material-credit.ts";
28
+ } from "../schemas/material-credit.ts";
29
29
 
30
- // RFC-0488: re-export label mapping helpers for @warpgogol/werkstatt-shared/share/material-credits consumers.
30
+ // RFC-0488: re-export label mapping helpers for @warpgogol/werkstatt-shared/attribution/material-credits consumers.
31
31
  export {
32
32
  labelForSourceType,
33
33
  labelForStatus,
34
34
  labelForUsageBasis,
35
- } from "./schemas/material-credit.ts";
35
+ } from "../schemas/material-credit.ts";
36
36
  export type {
37
37
  MaterialSourceType,
38
38
  MaterialCreditStatus,
39
39
  UsageBasisType,
40
- } from "./schemas/material-credit.ts";
40
+ } from "../schemas/material-credit.ts";
41
41
 
42
42
  export interface MaterialCreditRecord {
43
43
  file: string;
@@ -6,7 +6,12 @@
6
6
  </non-goals>
7
7
  </MODULE_CONTRACT>
8
8
  <CHANGE_SUMMARY>
9
- <item>Initial implementation for check-warpgogol hints support.</item>
9
+ <item>RFC-1097: step 6 — compass.migrate codemod run
10
+
11
+ Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
12
+ <item>RFC-1097: sweep — werkstatt-engine clean
13
+
14
+ Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
10
15
  </CHANGE_SUMMARY>
11
16
  */
12
17
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Shared check infrastructure barrel for @warpgogol/werkstatt-shared — exports diagnosticsResult, suppressions, i18n, and astro-site-url helpers (RFC-0868).</purpose>
3
+ <purpose>Shared checks index barrel for @warpgogol/werkstatt-shared — exports diagnosticsResult, suppressions, i18n, and astro-site-url helpers (RFC-0868).</purpose>
4
4
  <non-goals>
5
5
  <item>Do not export site-specific validators or pipeline definitions.</item>
6
6
  <item>Do not import from @warpgogol/werkstatt-site or any stack plugin.</item>
@@ -8,6 +8,9 @@
8
8
  </MODULE_CONTRACT>
9
9
  <CHANGE_SUMMARY>
10
10
  <item>RFC-0868: extracted from werkstatt-site/src/checks as shared infrastructure.</item>
11
+ <item>RFC-1097: sweep — tail packages clean
12
+
13
+ Sweep batch 3: rewrote ~95 purposes across werkstatt-knowledge, werkstatt-shared, godot-game, phaser-game, lifecycle-core, projektarchiv-*, portal-*, billing-*, typescript (CONTRACT-02/PURPOSE-02). Real KEY_DECISIONS on 5 godot utils, non-goals on 5 CONTRACT-03 files, headers on 4 headerless files, CS-07 history literal fix on 2 files. Policy: vitest.config.ts + test-fixtures testPatterns, worker-configuration.d.ts excludedPath. All non-site/engine packages now 0 diagnostics.</item>
11
14
  </CHANGE_SUMMARY>
12
15
  */
13
16
 
@@ -6,7 +6,12 @@
6
6
  </non-goals>
7
7
  </MODULE_CONTRACT>
8
8
  <CHANGE_SUMMARY>
9
- <item>Added Compass scaffolding.</item>
9
+ <item>RFC-1097: step 6 — compass.migrate codemod run
10
+
11
+ Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
12
+ <item>RFC-1097: sweep — werkstatt-engine clean
13
+
14
+ Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
10
15
  </CHANGE_SUMMARY>
11
16
  */
12
17
 
@@ -1,3 +1,17 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>i18n helpers for check validators — read the default language code from a site system.md frontmatter.</purpose>
4
+ <non-goals>
5
+ <item>Do not load translation catalogs — this module only resolves the default language code.</item>
6
+ </non-goals>
7
+ </MODULE_CONTRACT>
8
+ <CHANGE_SUMMARY>
9
+ <item>RFC-1097: sweep — tail packages clean
10
+
11
+ Sweep batch 3: rewrote ~95 purposes across werkstatt-knowledge, werkstatt-shared, godot-game, phaser-game, lifecycle-core, projektarchiv-*, portal-*, billing-*, typescript (CONTRACT-02/PURPOSE-02). Real KEY_DECISIONS on 5 godot utils, non-goals on 5 CONTRACT-03 files, headers on 4 headerless files, CS-07 history literal fix on 2 files. Policy: vitest.config.ts + test-fixtures testPatterns, worker-configuration.d.ts excludedPath. All non-site/engine packages now 0 diagnostics.</item>
12
+ </CHANGE_SUMMARY>
13
+ */
14
+
1
15
  import { join } from "node:path";
2
16
  import { readFile } from "node:fs/promises";
3
17
  import { parse as parseYaml } from "yaml";