@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.
- package/package.json +19 -4
- package/src/checks/index.ts +1 -0
- package/src/checks/result-helpers.ts +60 -6
- package/src/checks/suppressions-config.ts +26 -1
- package/src/content/system-manifest.ts +8 -0
- package/src/ontology/archetypes/index.json +17 -1
- package/src/ontology/schemas/page-entry.ts +5 -7
- package/src/ontology/schemas/system/manifest.ts +8 -0
- package/src/ontology/schemas/system/verification.ts +40 -0
- package/src/passport/sign.ts +20 -14
- package/src/share/middleware/access-protection.ts +174 -0
- package/src/share/middleware/tests/access-protection.test.ts +123 -0
- package/src/share/page.ts +4 -2
- package/src/share/routes/template-filter.ts +36 -0
- package/src/share/routes/tests/template-filter.test.ts +40 -0
- package/src/share/scripts/lenis.ts +1 -0
- package/src/share/semantic/block-extractors/index.ts +24 -0
- package/src/share/semantic/build-page.ts +39 -1
- package/src/share/semantic/extract.ts +85 -11
- package/src/share/semantic/ids.ts +13 -0
- package/src/share/semantic/jsonld/organization.ts +20 -0
- package/src/share/semantic/jsonld/video.ts +56 -0
- package/src/share/semantic/jsonld/webpage.ts +1 -1
- package/src/share/semantic/jsonld.ts +5 -0
- package/src/share/semantic/models.ts +9 -0
- package/src/share/semantic/organization-profile.ts +3 -2
- package/src/share/semantic/page-utils.ts +4 -10
- package/src/share/semantic/tests/split-sentences.test.ts +97 -0
- package/src/share/slug/heading-slugger.ts +26 -0
- package/src/share/slug/index.ts +15 -0
- package/src/share/slug/slug-id.ts +22 -0
- package/src/share/slug/slug-url.ts +24 -0
- package/src/share/slug/strategies.ts +68 -0
- package/src/share/slug/tests/slug.test.ts +84 -0
- package/src/share/tests/build-page-price-markers.test.ts +3 -0
- package/src/share/tests/jsonld-video.test.ts +143 -0
- package/src/share/tests/jsonld-webpage.test.ts +69 -0
- package/src/share/tests/organization-jsonld.test.ts +52 -0
- package/src/share/types/axiom-study.d.ts +10 -2
- package/src/share/utility-registry.yaml +36 -0
- package/src/surface/blueprint-schema.ts +1 -1
- package/src/surface/blueprint-types.ts +1 -1
- 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<{
|
|
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({
|
|
@@ -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
|
-
});
|