feat(core-consent): scaffold package with types, IConsent, withConsent brand wrapper

- Add packages/core-consent with ConsentCategory, ConsentState,
  UserConsentState types and IConsent interface
- Add withConsent wrapper attaching __consentChecked brand at bind time;
  unit tests assert brand attachment and factory passthrough
- Add ConsentChecked<F> type to core-shared/conformance/brands.ts and
  isConsentChecked helper to brand-runtime.ts
- Extend FeatureManifest with requiresConsent?: readonly string[] field
- Extend assertFeatureConformance to require __consentChecked brand when
  requiresConsent.length > 0; synthetic fixture tests cover pass/fail cases
- Propagate __consentChecked in withSpan PROPAGATED_BRANDS so the outermost
  binding carries the brand

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 10:40:40 +00:00
parent f5d08dc84a
commit 9cb2fa321c
20 changed files with 410 additions and 27 deletions

View File

@@ -1,18 +1,18 @@
{
"generatedAt": "2026-05-19T10:16:15.209Z",
"commit": "8cf9f4b",
"generatedAt": "2026-05-19T10:39:50.009Z",
"commit": "f5d08dc",
"repo": {
"statements": 96.48,
"branches": 91.72,
"functions": 96.83,
"lines": 96.48,
"statements": 96.5,
"branches": 91.82,
"functions": 96.89,
"lines": 96.5,
"counts": {
"lf": 4264,
"lh": 4114,
"brf": 809,
"brh": 742,
"fnf": 252,
"fnh": 244
"lf": 4291,
"lh": 4141,
"brf": 819,
"brh": 752,
"fnf": 257,
"fnh": 249
}
},
"byPackage": {
@@ -58,18 +58,32 @@
"fnh": 10
}
},
"@repo/core-shared": {
"statements": 98,
"branches": 95.81,
"functions": 92,
"lines": 98,
"@repo/core-consent": {
"statements": 100,
"branches": 100,
"functions": 100,
"lines": 100,
"counts": {
"lf": 1050,
"lh": 1029,
"brf": 310,
"brh": 297,
"fnf": 100,
"fnh": 92
"lf": 10,
"lh": 10,
"brf": 4,
"brh": 4,
"fnf": 4,
"fnh": 4
}
},
"@repo/core-shared": {
"statements": 98.03,
"branches": 95.89,
"functions": 92.08,
"lines": 98.03,
"counts": {
"lf": 1067,
"lh": 1046,
"brf": 316,
"brh": 303,
"fnf": 101,
"fnh": 93
}
},
"@repo/marketing-pages": {