@warpgogol/werkstatt-shared 0.8.0 → 0.8.2

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 (43) hide show
  1. package/package.json +19 -4
  2. package/src/checks/index.ts +1 -0
  3. package/src/checks/result-helpers.ts +60 -6
  4. package/src/checks/suppressions-config.ts +26 -1
  5. package/src/content/system-manifest.ts +8 -0
  6. package/src/ontology/archetypes/index.json +17 -1
  7. package/src/ontology/schemas/page-entry.ts +5 -7
  8. package/src/ontology/schemas/system/manifest.ts +8 -0
  9. package/src/ontology/schemas/system/verification.ts +40 -0
  10. package/src/passport/sign.ts +20 -14
  11. package/src/share/middleware/access-protection.ts +174 -0
  12. package/src/share/middleware/tests/access-protection.test.ts +123 -0
  13. package/src/share/page.ts +4 -2
  14. package/src/share/routes/template-filter.ts +36 -0
  15. package/src/share/routes/tests/template-filter.test.ts +40 -0
  16. package/src/share/scripts/lenis.ts +1 -0
  17. package/src/share/semantic/block-extractors/index.ts +24 -0
  18. package/src/share/semantic/build-page.ts +39 -1
  19. package/src/share/semantic/extract.ts +85 -11
  20. package/src/share/semantic/ids.ts +13 -0
  21. package/src/share/semantic/jsonld/organization.ts +20 -0
  22. package/src/share/semantic/jsonld/video.ts +56 -0
  23. package/src/share/semantic/jsonld/webpage.ts +1 -1
  24. package/src/share/semantic/jsonld.ts +5 -0
  25. package/src/share/semantic/models.ts +9 -0
  26. package/src/share/semantic/organization-profile.ts +3 -2
  27. package/src/share/semantic/page-utils.ts +4 -10
  28. package/src/share/semantic/tests/split-sentences.test.ts +97 -0
  29. package/src/share/slug/heading-slugger.ts +26 -0
  30. package/src/share/slug/index.ts +15 -0
  31. package/src/share/slug/slug-id.ts +22 -0
  32. package/src/share/slug/slug-url.ts +24 -0
  33. package/src/share/slug/strategies.ts +68 -0
  34. package/src/share/slug/tests/slug.test.ts +84 -0
  35. package/src/share/tests/build-page-price-markers.test.ts +3 -0
  36. package/src/share/tests/jsonld-video.test.ts +143 -0
  37. package/src/share/tests/jsonld-webpage.test.ts +69 -0
  38. package/src/share/tests/organization-jsonld.test.ts +52 -0
  39. package/src/share/types/axiom-study.d.ts +10 -2
  40. package/src/share/utility-registry.yaml +36 -0
  41. package/src/surface/blueprint-schema.ts +1 -1
  42. package/src/surface/blueprint-types.ts +1 -1
  43. package/src/share/tests/create-dev-props-validator.test.ts +0 -38
@@ -1,13 +1,21 @@
1
1
  declare module "@syrokomskyi/axiom-study" {
2
2
  export interface Finding {
3
3
  findingId: string;
4
- semanticFingerprint: string;
4
+ semanticFingerprint: { algorithm: "sha256"; digest: string; size: number; mediaType: string };
5
5
  methodologyId: string;
6
6
  ruleId: string;
7
7
  affectedSubjectId: string;
8
8
  title: string;
9
9
  severity: "info" | "low" | "medium" | "high" | "critical";
10
- evidence: Array<{ evidenceId: string; digest: string }>;
10
+ evidence: Array<{
11
+ evidenceRef: {
12
+ artifactId: string;
13
+ rootDigest: { algorithm: "sha256"; digest: string; size: number; mediaType: string };
14
+ schema: string;
15
+ };
16
+ selector: string;
17
+ evidenceClass: string;
18
+ }>;
11
19
  uncertainty: unknown[];
12
20
  extension: Record<string, unknown>;
13
21
  }
@@ -0,0 +1,36 @@
1
+ utilities:
2
+ - id: slug
3
+ canonicalPath: packages/werkstatt-shared/src/share/slug/
4
+ forbiddenImports:
5
+ - "@sindresorhus/slugify"
6
+ - "cyrillic-to-translit-js"
7
+ - "github-slugger"
8
+ functionNames:
9
+ - slugify
10
+ - toSlug
11
+ - makeSlug
12
+ - createSlug
13
+ - slugUrl
14
+ - slugId
15
+ patterns:
16
+ - id: nkfd-diacritic-strip
17
+ regex: "\\.normalize\\(.{0,5}NFKD.{0,5}\\)\\.replace"
18
+ description: NFKD normalize + diacritic strip + non-alphanumeric replace (legacy custom slugify pattern)
19
+ allowlist:
20
+ - path: packages/werkstatt-shared/src/share/slug/
21
+ reason: Canonical slug module — owns all slug generation logic (RFC-0915, DNA-88)
22
+ - path: packages/werkstatt-shared/src/share/semantic/extract.ts
23
+ reason: CHANGE_SUMMARY comment references slugify removal — no function definition remains
24
+ - path: packages/werkstatt-site/src/checks/tests/utility-provenance.test.ts
25
+ reason: Test file intentionally contains forbidden patterns to validate the provenance validator (RFC-0916)
26
+ - path: packages/werkstatt-site/src/checks/utility-provenance.ts
27
+ reason: Validator implementation references forbidden imports/function names in string literals for detection logic (RFC-0916)
28
+ - id: template-filter
29
+ canonicalPath: packages/werkstatt-shared/src/share/routes/
30
+ forbiddenImports: []
31
+ functionNames:
32
+ - hasPlaceholderRoutes
33
+ patterns: []
34
+ allowlist:
35
+ - path: packages/werkstatt-shared/src/share/routes/
36
+ reason: Canonical placeholder route filter — owns all template detection logic (RFC-0917)
@@ -53,7 +53,7 @@ const pillarAdaptationSchema = z.object({
53
53
  const pillarProductPriceSchema = z.object({
54
54
  heading: localizedString,
55
55
  body: localizedString,
56
- priceRef: z.string().min(1),
56
+ priceRef: z.string().min(1).optional(),
57
57
  });
58
58
 
59
59
  const pillarFinalCtaSchema = z.object({
@@ -52,7 +52,7 @@ export interface BlueprintPillarAdaptation {
52
52
  export interface BlueprintPillarProductPrice {
53
53
  heading: LocalizedString;
54
54
  body: LocalizedString;
55
- priceRef: string;
55
+ priceRef?: string;
56
56
  }
57
57
 
58
58
  export interface BlueprintPillarFinalCta {
@@ -1,38 +0,0 @@
1
- import { test, expect } from "vitest";
2
- import { createDevPropsValidator } from "../dev-props-validator.ts";
3
-
4
- /*
5
- <MODULE_CONTRACT>
6
- <purpose>
7
- RFC-0262: end-to-end test of createDevPropsValidator against the real
8
- packages/werkstatt-site/src/domain/ui/sections/hero manifest (this test runs from within the
9
- actual monorepo checkout, so workspace-root discovery resolves for real).
10
- </purpose>
11
- </MODULE_CONTRACT>
12
- */
13
-
14
- test("createDevPropsValidator: passes valid Europa (hero-section) props", async () => {
15
- const validate = createDevPropsValidator();
16
- await validate("Europa", { header: { heading: "Hello" } }, "hero-block"); // cosmic-literals-ignore: fixture cosmicName exercising the real hero-section manifest
17
- });
18
-
19
- test("createDevPropsValidator: throws PAGE-PROPS-01 on an undeclared prop key", async () => {
20
- const validate = createDevPropsValidator();
21
- try {
22
- await validate(
23
- "Europa", // cosmic-literals-ignore: fixture cosmicName exercising the real hero-section manifest
24
- { header: { heading: "Hello" }, totallyUnknownField: true },
25
- "hero-block",
26
- ); // cosmic-literals-ignore: fixture cosmicName exercising the real hero-section manifest
27
- expect.fail("should have thrown");
28
- } catch (error) {
29
- expect(error).toBeInstanceOf(Error);
30
- expect((error as Error).message).toMatch(/PAGE-PROPS-01/);
31
- expect((error as Error).message).toMatch(/hero-block/);
32
- }
33
- });
34
-
35
- test("createDevPropsValidator: an unknown planetName resolves no schema and does not throw", async () => {
36
- const validate = createDevPropsValidator();
37
- await validate("NotARealPlanet", { anything: true }, null);
38
- });