@wildo-ai/saas-specifications 1.1.7 → 1.1.9
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/dist/esm/_core/application-specification-family-identity.schemas.d.ts +9 -0
- package/dist/esm/_core/application-specification-family-identity.schemas.d.ts.map +1 -1
- package/dist/esm/_core/application-specification-family-identity.schemas.js +9 -0
- package/dist/esm/_core/application-specification-family-identity.schemas.js.map +1 -1
- package/dist/esm/_core/brand/brand-name-choice.d.ts +136 -0
- package/dist/esm/_core/brand/brand-name-choice.d.ts.map +1 -0
- package/dist/esm/_core/brand/brand-name-choice.js +193 -0
- package/dist/esm/_core/brand/brand-name-choice.js.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening-generation.schemas.d.ts +108 -0
- package/dist/esm/_core/brand/brand-name-screening-generation.schemas.d.ts.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening-generation.schemas.js +59 -0
- package/dist/esm/_core/brand/brand-name-screening-generation.schemas.js.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening-validation.d.ts +51 -0
- package/dist/esm/_core/brand/brand-name-screening-validation.d.ts.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening-validation.js +157 -0
- package/dist/esm/_core/brand/brand-name-screening-validation.js.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening-view.d.ts +120 -0
- package/dist/esm/_core/brand/brand-name-screening-view.d.ts.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening-view.js +47 -0
- package/dist/esm/_core/brand/brand-name-screening-view.js.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening.family-aspects.d.ts +3 -0
- package/dist/esm/_core/brand/brand-name-screening.family-aspects.d.ts.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening.family-aspects.js +42 -0
- package/dist/esm/_core/brand/brand-name-screening.family-aspects.js.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening.schemas.d.ts +310 -0
- package/dist/esm/_core/brand/brand-name-screening.schemas.d.ts.map +1 -0
- package/dist/esm/_core/brand/brand-name-screening.schemas.js +272 -0
- package/dist/esm/_core/brand/brand-name-screening.schemas.js.map +1 -0
- package/dist/esm/_core/brand/brand-snapshot.schemas.d.ts +23 -0
- package/dist/esm/_core/brand/brand-snapshot.schemas.d.ts.map +1 -1
- package/dist/esm/_core/brand/brand-snapshot.schemas.js +32 -0
- package/dist/esm/_core/brand/brand-snapshot.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts +10 -0
- package/dist/esm/_core/build-plan/build-plan-task-graph-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts +57 -0
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js +89 -0
- package/dist/esm/_core/build-plan/build-plan-task-graph-validation.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +79 -19
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +61 -11
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +18 -2
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.d.ts +28 -4
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js +53 -5
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-generation.schemas.js.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts +24 -4
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.d.ts.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.js +64 -4
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot-validation.js.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.d.ts +59 -0
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.js +64 -0
- package/dist/esm/_core/business-model-lite/business-model-lite-snapshot.schemas.js.map +1 -1
- package/dist/esm/_core/business-model-lite/pricing-plan.schemas.d.ts +3 -0
- package/dist/esm/_core/business-model-lite/pricing-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/business-model-lite/pricing-plan.schemas.js +16 -0
- package/dist/esm/_core/business-model-lite/pricing-plan.schemas.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts +7 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition-validation.js +34 -28
- package/dist/esm/_core/capability-composition/capability-composition-validation.js.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts +75 -4
- package/dist/esm/_core/capability-composition/capability-composition.schemas.d.ts.map +1 -1
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js +62 -4
- package/dist/esm/_core/capability-composition/capability-composition.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +7 -0
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.d.ts +153 -0
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.d.ts.map +1 -0
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js +241 -0
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js.map +1 -0
- package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.d.ts +8 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.d.ts.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.js +19 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set-validation.js.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.d.ts +61 -3
- package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.d.ts.map +1 -1
- package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.js +73 -3
- package/dist/esm/_core/domain-plan/domain-plan-output-set.schemas.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.family-aspects.js +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js +1 -0
- package/dist/esm/_core/experience-plan/experience-plan.schemas.js.map +1 -1
- package/dist/esm/_core/family-aspects.registry.d.ts.map +1 -1
- package/dist/esm/_core/family-aspects.registry.js +2 -0
- package/dist/esm/_core/family-aspects.registry.js.map +1 -1
- package/dist/esm/_core/index.d.ts +6 -0
- package/dist/esm/_core/index.d.ts.map +1 -1
- package/dist/esm/_core/index.js +6 -0
- package/dist/esm/_core/index.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +5 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/market/market-icp.schemas.d.ts +7 -0
- package/dist/esm/_core/market/market-icp.schemas.d.ts.map +1 -1
- package/dist/esm/_core/market/market-icp.schemas.js +7 -0
- package/dist/esm/_core/market/market-icp.schemas.js.map +1 -1
- package/dist/esm/_core/market/market-language-coverage.d.ts +62 -0
- package/dist/esm/_core/market/market-language-coverage.d.ts.map +1 -0
- package/dist/esm/_core/market/market-language-coverage.js +48 -0
- package/dist/esm/_core/market/market-language-coverage.js.map +1 -0
- package/dist/esm/_core/market/market-snapshot-validation.js +2 -2
- package/dist/esm/_core/market/market-snapshot-validation.js.map +1 -1
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts +63 -2
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js +73 -5
- package/dist/esm/application-creation/application-creator-inputs.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/application-line.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/application-line.application-creation.schemas.js +2 -0
- package/dist/esm/application-creation/application-line.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +28 -0
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +19 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts +1 -0
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js +1 -0
- package/dist/esm/application-creation/structured-artifact-landing.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +7 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +7 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/application-risk-signals.derivations.d.ts +20 -0
- package/dist/esm/assurance/application-risk-signals.derivations.d.ts.map +1 -1
- package/dist/esm/assurance/application-risk-signals.derivations.js +81 -0
- package/dist/esm/assurance/application-risk-signals.derivations.js.map +1 -1
- package/dist/esm/assurance/governed-document-release.d.ts +9 -0
- package/dist/esm/assurance/governed-document-release.d.ts.map +1 -1
- package/dist/esm/assurance/governed-document-release.js +9 -0
- package/dist/esm/assurance/governed-document-release.js.map +1 -1
- package/dist/esm/companion-exports.d.ts +10 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts +1 -0
- package/dist/esm/engine/infrastructure/resources/job-executions.resource.specification.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.d.ts +0 -24
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.d.ts.map +0 -1
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js +0 -24
- package/dist/esm/assurance/__tests__/authority-evaluation-instant.fixture.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { ApplicationRiskSignalRef } from "@wildo-ai/saas-models";
|
|
2
|
+
import { BrandSnapshotSchema } from "../_core/brand/brand-snapshot.schemas.js";
|
|
3
|
+
import { BrandNameScreeningSchema, deriveBrandNameTrademarkOutcome, uncoveredBrandNameJurisdictions, } from "../_core/brand/brand-name-screening.schemas.js";
|
|
4
|
+
import { BrandNameChoiceStanding, deriveBrandNameChoiceStanding, marketCompetitorNames, readCreatorBrandNameDecisions } from "../_core/brand/brand-name-choice.js";
|
|
5
|
+
import { ApplicationSpecificationFamily } from "../_core/application-specification-family-identity.schemas.js";
|
|
6
|
+
import { ApplicationCreatorInputsSchema } from "../application-creation/application-creator-inputs.application-creation.schemas.js";
|
|
7
|
+
import { resolveNotApplicableFamilies } from "../application-creation/application-line.application-creation.schemas.js";
|
|
2
8
|
/**
|
|
3
9
|
* The DERIVED risk signals (#300 Layer 1), as pure functions of what an application declares.
|
|
4
10
|
*
|
|
@@ -226,4 +232,79 @@ export function deriveMcpExposureSignal(input) {
|
|
|
226
232
|
detail: { ownExposed: input.ownExposed, ownOperations: input.ownOperations, inheritedExposed: input.inheritedExposed },
|
|
227
233
|
});
|
|
228
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Where the brand's chosen NAME stands against its minimal trademark screening.
|
|
237
|
+
*
|
|
238
|
+
* Takes the RAW landed values (brand, screening, market, dossier) and parses them itself, so the companion
|
|
239
|
+
* and the assurance report — the two homes that read this — cannot compute it differently. Standing comes
|
|
240
|
+
* from `deriveBrandNameChoiceStanding`, the same function the coherence report and the brand-name choice use.
|
|
241
|
+
*
|
|
242
|
+
* - The line carries no brand (an internal tool): a COMPUTED absence.
|
|
243
|
+
* - No brand name yet: nothing to be exposed by, and not an absence either — the name is still to come.
|
|
244
|
+
* - Cleared: screened in every declared jurisdiction and class with no conflict found. Still a screening, not
|
|
245
|
+
* a clearance, which the observation says.
|
|
246
|
+
* - Screening incomplete, kept despite a conflict, or never screened: the exposure is PRESENT, with the
|
|
247
|
+
* conflicting marks or the uncovered jurisdictions in `detail`.
|
|
248
|
+
*/
|
|
249
|
+
export function deriveBrandNameTrademarkSignal(input) {
|
|
250
|
+
const provenance = {
|
|
251
|
+
inputs: ["brand-brief (name)", "brand-name-screening", "market-snapshot (alternatives)", "creator-inputs (application line)"],
|
|
252
|
+
derivation: "the brand name matched to its screened candidate; standing derived from the candidate's register queries",
|
|
253
|
+
};
|
|
254
|
+
const dossier = ApplicationCreatorInputsSchema.safeParse(input.creatorInputs);
|
|
255
|
+
if (resolveNotApplicableFamilies(dossier.success ? dossier.data : undefined).has(ApplicationSpecificationFamily.BRAND_BRIEF)) {
|
|
256
|
+
return signal({
|
|
257
|
+
ref: ApplicationRiskSignalRef.BRAND_NAME_TRADEMARK_STANDING,
|
|
258
|
+
home: RiskSignalHome.APPLICATION_EVALUATION_TIME,
|
|
259
|
+
observation: "This application's line carries no brand, so there is no brand name to screen.",
|
|
260
|
+
provenance,
|
|
261
|
+
absent: true,
|
|
262
|
+
avoidableExposure: avoidable(false, "a brand name not cleared by its trademark screening"),
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
const brand = BrandSnapshotSchema.safeParse(input.brand);
|
|
266
|
+
if (!brand.success) {
|
|
267
|
+
return signal({
|
|
268
|
+
ref: ApplicationRiskSignalRef.BRAND_NAME_TRADEMARK_STANDING,
|
|
269
|
+
home: RiskSignalHome.APPLICATION_EVALUATION_TIME,
|
|
270
|
+
observation: "No brand name has been chosen yet, so there is no name to stand against a trademark screening.",
|
|
271
|
+
provenance,
|
|
272
|
+
avoidableExposure: avoidable(false, "a brand name not cleared by its trademark screening"),
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
const parsedScreening = BrandNameScreeningSchema.safeParse(input.screening);
|
|
276
|
+
const screening = parsedScreening.success ? parsedScreening.data : undefined;
|
|
277
|
+
const alternatives = input.market?.alternatives;
|
|
278
|
+
const brandName = brand.data.name.brandName;
|
|
279
|
+
const { standing, candidate } = deriveBrandNameChoiceStanding({
|
|
280
|
+
brandName,
|
|
281
|
+
screening,
|
|
282
|
+
competitorNames: marketCompetitorNames(alternatives),
|
|
283
|
+
chosenBrandNameAnswer: readCreatorBrandNameDecisions(dossier.success ? dossier.data : undefined).chosenBrandNameAnswer,
|
|
284
|
+
});
|
|
285
|
+
const conflictingMarks = (candidate?.trademarkQueries ?? []).flatMap((query) => query.conflictingMarks.map((mark) => ({ mark: mark.mark, register: query.register, status: mark.status, sourceUrl: mark.sourceUrl })));
|
|
286
|
+
const uncovered = screening && candidate ? [...uncoveredBrandNameJurisdictions(screening, candidate)] : [];
|
|
287
|
+
const observation = {
|
|
288
|
+
[BrandNameChoiceStanding.CLEARED]: `The brand name "${brandName}" was screened in every declared jurisdiction and class with no live conflicting mark found — a minimal screening, not a legal clearance.`,
|
|
289
|
+
[BrandNameChoiceStanding.SCREENING_INCOMPLETE]: `The brand name "${brandName}" was screened incompletely: not cleared in ${uncovered.join(", ") || "a register that could not be read"}.`,
|
|
290
|
+
[BrandNameChoiceStanding.KEPT_DESPITE_CONFLICT]: `The brand name "${brandName}" was kept although its screening found ${conflictingMarks.length > 0 ? `${conflictingMarks.length} live conflicting mark(s)` : "a named competitor with the same or a close name"}.`,
|
|
291
|
+
[BrandNameChoiceStanding.CONFLICT_UNACKNOWLEDGED]: `The screening now finds ${conflictingMarks.length > 0 ? `${conflictingMarks.length} live conflicting mark(s)` : "a named competitor with the same or a close name"} for the brand name "${brandName}", and nobody chose to keep it despite that.`,
|
|
292
|
+
[BrandNameChoiceStanding.NOT_SCREENED]: `The brand name "${brandName}" has never been screened against the trademark registers.`,
|
|
293
|
+
}[standing];
|
|
294
|
+
return signal({
|
|
295
|
+
ref: ApplicationRiskSignalRef.BRAND_NAME_TRADEMARK_STANDING,
|
|
296
|
+
home: RiskSignalHome.APPLICATION_EVALUATION_TIME,
|
|
297
|
+
observation,
|
|
298
|
+
provenance,
|
|
299
|
+
detail: {
|
|
300
|
+
brandName,
|
|
301
|
+
standing,
|
|
302
|
+
candidateRef: candidate?.ref ?? null,
|
|
303
|
+
trademarkOutcome: screening && candidate ? deriveBrandNameTrademarkOutcome(screening, candidate) : null,
|
|
304
|
+
conflictingMarks,
|
|
305
|
+
uncoveredJurisdictions: uncovered,
|
|
306
|
+
},
|
|
307
|
+
avoidableExposure: avoidable(standing !== BrandNameChoiceStanding.CLEARED, "a brand name not cleared by its trademark screening"),
|
|
308
|
+
});
|
|
309
|
+
}
|
|
229
310
|
//# sourceMappingURL=application-risk-signals.derivations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-risk-signals.derivations.js","sourceRoot":"","sources":["../../../../src/assurance/application-risk-signals.derivations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAuC,MAAM,uBAAuB,CAAC;AAEtG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,+DAA6C,CAAA;IAC7C,6EAA2D,CAAA;AAC7D,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAiCD,SAAS,MAAM,CA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AAU,EAAE,iEAAiE,EAAE;YAC9I,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;YACrC,iBAAiB,EAAE,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,sDAAsD,CAAC;YACjH,MAAM,EAAE,KAAK,CAAC,UAAU;SACzB,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAIvC;IACC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,gBAAgB,CAAC;IACxD,OAAO,MAAM,CAAC;QACZ,GAAG,EAAE,wBAAwB,CAAC,qBAAqB;QACnD,IAAI,EAAE,cAAc,CAAC,2BAA2B;QAChD,WAAW,EAAE,KAAK,KAAK,CAAC;YACtB,CAAC,CAAC,+JAA+J;YACjK,CAAC,CAAC,GAAG,KAAK,+DAA+D,KAAK,CAAC,UAAU,8BAA8B,KAAK,CAAC,aAAa,UAAU,KAAK,CAAC,gBAAgB,yHAAyH;QACrS,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,+DAA+D,EAAE,kCAAkC,CAAC,EAAE,UAAU,EAAE,sFAAsF,EAAE;QACjO,+FAA+F;QAC/F,yEAAyE;QACzE,MAAM,EAAE,KAAK;QACb,+FAA+F;QAC/F,+EAA+E;QAC/E,iBAAiB,EAAE,SAAS,CAAC,KAAK,GAAG,CAAC,EAAE,oDAAoD,CAAC;QAC7F,MAAM,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE;KACvH,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { ApplicationRiskSignalRef, type UnansweredPersonalDataResource } from \"@wildo-ai/saas-models\";\n\n/**\n * The DERIVED risk signals (#300 Layer 1), as pure functions of what an application declares.\n *\n * ## Why they live in the engine\n *\n * They were authored in `scripts/assurance/report-risk-signals.mjs` and were reachable only there,\n * which made the `top_down.risk-register` method's derived half permanently absent: that playbook is\n * a tool-less structured generation, it says \"if signals were not supplied to this run…\", and\n * nothing has ever supplied them (#1435). The creation lane may not depend on the assurance plane —\n * `application-creation-directive.md` keeps that street one-way, and those scripts carry hard exits\n * that are right for an auditor's tool and wrong inside a run that must not stop — so the shared\n * thing had to move to where BOTH may read it. The engine is that place: every input is an engine\n * vocabulary or an application declaration, and both consumers already depend on the engine.\n *\n * The alternative was a second derivation in the companion. Rejected: two sets of observation\n * sentences about the same measurement is exactly the duplication that drifts invisibly, and the\n * script's own `assertSignalVocabularyMatches` exists because its author had already met the\n * transcription half of that problem.\n *\n * ## The one thing this layer must never become\n *\n * > *\"The derived layer emits SIGNALS with provenance, never risk conclusions. Marker density\n * > measures annotation effort, not control strength; capability enablement measures surface, not\n * > exposure severity. Auto-computing a risk SCORE from proxies recreates the false-agreement\n * > failure with more math and more confidence.\"*\n *\n * So nothing here multiplies, weights, ranks or totals a proxy into a number that reads as risk.\n * Every signal is a measured fact plus the inputs it came from; what it MEANS is Layer 3's question,\n * answered by a pass that reads the signals in context and is reviewed.\n *\n * ## The refs are the ENUM, not literals\n *\n * The script transcribed `ApplicationRiskSignalRef`'s values as string literals and guarded the\n * transcription with a two-way drift assertion. Keying on the enum removes the transcription\n * instead of checking it — the guard stays useful for the OTHER half of its job, which is refusing\n * a declared member that no signal measures.\n */\n\n/**\n * The two computation times. Never merged: a signal recomputed in the wrong home is a wrong answer\n * that looks right — the framework half needs engine SOURCE, which a deployed application cannot\n * see, and the application half needs the application's own configuration.\n */\nexport enum RiskSignalHome {\n FRAMEWORK_BUILD_TIME = \"FRAMEWORK_BUILD_TIME\",\n APPLICATION_EVALUATION_TIME = \"APPLICATION_EVALUATION_TIME\",\n}\n\n/** What a signal can contradict, where the question \"is the exposure present?\" is answerable at all. */\nexport interface AvoidableExposure {\n readonly present: boolean;\n readonly what: string;\n}\n\n/**\n * One derived signal.\n *\n * `observation` is a FACT. There is deliberately no `score`, `weight`, `level` or `severity` field —\n * adding one is how this layer stops being a derivation and starts being an unreviewed conclusion.\n */\nexport interface DerivedRiskSignal {\n readonly signalRef: string;\n readonly home: RiskSignalHome;\n readonly observation: string;\n readonly provenance: { readonly inputs?: readonly string[]; readonly derivation?: string };\n /** A COMPUTED absence — the exposure is structurally not there — never \"nobody wrote it down\". */\n readonly absent: boolean;\n readonly detail: unknown;\n /**\n * `{ present, what }` where the question is answerable, `null` where it is not — and the null is a\n * decision rather than an omission. \"Is the exposure present?\" is sharp for a vendor-hosted\n * provider or an operation reachable over MCP, and genuinely ambiguous for the capability surface\n * (is an ENABLED capability an exposure, or is a disabled one an absence?) and for the\n * personal-data inventory (every application processes some personal data; the exposure is which\n * kind, not whether).\n */\n readonly avoidableExposure: AvoidableExposure | null;\n}\n\nfunction signal(input: {\n ref: ApplicationRiskSignalRef;\n home: RiskSignalHome;\n observation: string;\n provenance: DerivedRiskSignal[\"provenance\"];\n absent?: boolean;\n detail?: unknown;\n avoidableExposure?: AvoidableExposure | null;\n}): DerivedRiskSignal {\n return {\n signalRef: `risk-signal:${input.ref}`,\n home: input.home,\n observation: input.observation,\n provenance: input.provenance,\n absent: input.absent ?? false,\n detail: input.detail ?? null,\n avoidableExposure: input.avoidableExposure ?? null,\n };\n}\n\nconst avoidable = (present: boolean, what: string): AvoidableExposure => ({ present, what });\n\n/**\n * Which engine capabilities this application turned on — TOTAL over the vocabulary.\n *\n * Total rather than a list of what is enabled, following `undeclaredRetentionClasses`' pattern: a\n * capability added to the vocabulary tomorrow is reported as not-enabled by every existing\n * application rather than silently omitted. The DISABLED half is the part a static register cannot\n * state — a capability that is off forecloses the exposures that ride it.\n */\nexport function deriveCapabilitySignal(input: { enabledRefs: ReadonlySet<string>; allRefs: readonly string[] }): DerivedRiskSignal {\n const enabled = [...input.enabledRefs].sort();\n const disabled = input.allRefs.filter((ref) => !input.enabledRefs.has(ref)).sort();\n return signal({\n ref: ApplicationRiskSignalRef.CAPABILITY_SURFACE,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: `${enabled.length} of ${input.allRefs.length} engine capabilities are enabled; ${disabled.length} are off and the exposures that ride them are structurally absent.`,\n provenance: { inputs: [\"wildo.saas.config.ts engineCapabilities\", \"EngineCapability vocabulary\"], derivation: \"total over the vocabulary, enabled vs not\" },\n detail: { enabled, disabled },\n });\n}\n\n/**\n * Which retention classes the application declared a period for, and which it has not.\n *\n * Reuses the engine's OWN `undeclaredRetentionClasses` rather than re-deriving it: a predicate\n * re-implemented in a script drifts, and the evidence would then describe the script.\n */\nexport function deriveRetentionSignal(input: { declaredClasses: readonly string[]; undeclared: readonly string[] }): DerivedRiskSignal {\n return signal({\n ref: ApplicationRiskSignalRef.RETENTION_DECLARATION,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: input.undeclared.length === 0\n ? `Every retention class the vocabulary carries has a declared period (${input.declaredClasses.length}).`\n : `${input.declaredClasses.length} retention class(es) declared, ${input.undeclared.length} with no declared period.`,\n provenance: { inputs: [\"the application ApplicationRetentionSchedule\", \"DataRetentionClass vocabulary\"], derivation: \"engine undeclaredRetentionClasses\" },\n absent: input.undeclared.length === 0,\n avoidableExposure: avoidable(input.undeclared.length > 0, \"retention classes with no declared period\"),\n detail: { declared: input.declaredClasses, undeclared: input.undeclared },\n });\n}\n\n/**\n * Vendor-hosted versus self-hosted providers — the third-party-processor exposure.\n *\n * #300's own example of a computed absence: an application with no vendor-hosted provider has NO\n * third-party-processor exposure, and a static register cannot honestly say that — it can only fail\n * to mention it.\n *\n * UNDECLARED is not ABSENT, and conflating them is the one way this signal can lie. The compliance\n * choice is an operator DECLARATION (`deploymentModel`), required even when a provider supports only\n * one model, because whether personal data leaves the operator's control is the single most\n * consequential fact a notice states about a provider. A provider that declares nothing has not told\n * us it is self-hosted; it has told us nothing. Reporting zero vendor-hosted providers as a computed\n * absence there would turn a MISSING DECLARATION into evidence of no exposure — the exact inversion\n * this derived layer exists to avoid, and the more dangerous one, because a static register at least\n * cannot claim it.\n *\n * Measured on Wonder Todos, which is why this paragraph exists: its three configured providers\n * include two obvious vendor-hosted LLM APIs and declare no deployment model at all. An earlier\n * version reported \"third-party-processor exposure is computed ABSENT\".\n */\nexport function deriveProviderHostingSignal(input: {\n vendorHosted: readonly string[];\n selfHosted: readonly string[];\n undeclared: readonly string[];\n}): DerivedRiskSignal {\n const total = input.vendorHosted.length + input.selfHosted.length + input.undeclared.length;\n const detail = { vendorHosted: input.vendorHosted, selfHosted: input.selfHosted, undeclared: input.undeclared };\n if (input.undeclared.length > 0) {\n return signal({\n ref: ApplicationRiskSignalRef.PROVIDER_HOSTING,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: `${input.undeclared.length} of ${total} configured provider(s) declare no deployment model, so third-party-processor exposure is UNDETERMINED — an undeclared choice is not a computed absence.`,\n provenance: { inputs: [\"the application providerComplianceChoices\", \"the application providerConfigurations as the configured population\"], derivation: \"engine vendorHostedProviderRefs, and the configured providers it names nothing for\" },\n absent: false,\n // UNDETERMINED, so the avoidable question is unanswerable here: treating it as 'exposure\n // absent' would let a declared posture of AVOIDED pass unchallenged on exactly the\n // application that declared nothing.\n avoidableExposure: null,\n detail,\n });\n }\n return signal({\n ref: ApplicationRiskSignalRef.PROVIDER_HOSTING,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: input.vendorHosted.length === 0\n ? `Every configured provider (${total}) declares a deployment model and NONE is vendor-hosted, so third-party-processor exposure is computed ABSENT rather than unstated.`\n : `${input.vendorHosted.length} of ${total} configured provider(s) are vendor-hosted, each a third-party processor.`,\n provenance: { inputs: [\"the application providerComplianceChoices\"], derivation: \"engine vendorHostedProviderRefs\" },\n absent: input.vendorHosted.length === 0,\n avoidableExposure: avoidable(input.vendorHosted.length > 0, \"vendor-hosted providers, each a third-party processor\"),\n detail,\n });\n}\n\n/**\n * Which personal-data categories this application's OWN resources declare, totalled over the vocabulary.\n *\n * Derived from the application's schemas rather than from anything anyone typed about them:\n * `resolveResourcePersonalDataCategories` reads the `.dataCategories()` declarations off each\n * resource's main schema, which is the same source the subject-export and impersonalization\n * machinery reads.\n *\n * SPECIAL CATEGORY is reported separately and deliberately. It is not \"more\" personal data on a\n * scale — it is data that needs a condition beyond the ordinary lawful basis before it may be\n * processed at all, so folding it into a count would lose the only distinction that changes what an\n * operator must have. Still a SIGNAL: that special-category data is declared is a fact, not a finding.\n *\n * Engine resources are excluded from the denominator on the engine's own reasoning: an application\n * author cannot change their posture, and including them would put permanent entries in front of\n * every reader of a report about THEIR application.\n */\nexport function derivePersonalDataSignals(input: {\n declaredCategories: readonly string[];\n allCategories: readonly string[];\n specialCategories: readonly string[];\n /**\n * The resources that said nothing, as `collectApplicationResourcesWithNoPersonalDataDeclaration`\n * returns them — carried through to `detail` whole rather than counted away, because WHICH\n * resources are silent is the only actionable half of this signal.\n */\n unanswered: readonly UnansweredPersonalDataResource[];\n applicationResourceCount: number;\n}): readonly DerivedRiskSignal[] {\n const declared = [...new Set(input.declaredCategories)].sort();\n const undeclared = input.allCategories.filter((category) => !declared.includes(category)).sort();\n const special = declared.filter((category) => input.specialCategories.includes(category)).sort();\n return [\n signal({\n ref: ApplicationRiskSignalRef.PERSONAL_DATA_INVENTORY,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: declared.length === 0\n ? `No application resource declares a personal-data category (${input.allCategories.length} in the vocabulary), so the data-sensitivity surface is UNDECLARED rather than empty.`\n : `${declared.length} of ${input.allCategories.length} personal-data categories are declared across this application's own resources; ${undeclared.length} are not present.`\n + (special.length === 0 ? \" None is a special category.\" : ` ${special.length} of them are SPECIAL CATEGORY, which needs a processing condition beyond the ordinary lawful basis.`),\n provenance: { inputs: [\".dataCategories() declarations on application resource schemas\", \"PersonalDataCategory vocabulary\"], derivation: \"engine resolveResourcePersonalDataCategories, totalled over the vocabulary\" },\n // Never an absence: nothing declared means nobody said, which is the opposite of nothing held.\n absent: false,\n detail: { declared, undeclared, specialCategory: special },\n }),\n signal({\n ref: ApplicationRiskSignalRef.PERSONAL_DATA_DECLARATION_GAP,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: input.unanswered.length === 0\n ? `All ${input.applicationResourceCount} of this application's own resources have answered the personal-data question.`\n : `${input.unanswered.length} of ${input.applicationResourceCount} of this application's own resources have said NOTHING about personal data — no retention treatment, no data-subject policy, no subject-export posture and no declared category.`,\n provenance: { inputs: [\"application resource configurations\"], derivation: \"engine collectApplicationResourcesWithNoPersonalDataDeclaration\" },\n absent: input.unanswered.length === 0,\n avoidableExposure: avoidable(input.unanswered.length > 0, \"resources that have said nothing about personal data\"),\n detail: input.unanswered,\n }),\n ];\n}\n\n/**\n * What an external agent can reach through the MCP transport.\n *\n * \"External-client risk classes present or structurally absent\" needed correcting against the code\n * before it could be derived. **The default `/mcp` and `/a2a` transports are mounted for EVERY\n * application** — the resource-server registry says so at its own site — so the transport is never\n * structurally absent and an application never chose it.\n *\n * What an application DOES choose is what is reachable through it: `mcp: { exposed: true }` on a\n * resource OPERATION, which is the whole of it. Zero exposed operations is therefore a real and\n * useful answer: the door is open and the room is empty.\n *\n * Engine and application operations are counted apart for the same reason the personal-data gap\n * separates them — an application author chooses one set and inherits the other — but BOTH are\n * reported, because an external agent reaches whatever is exposed regardless of who declared it.\n */\nexport function deriveMcpExposureSignal(input: {\n ownExposed: number;\n ownOperations: number;\n inheritedExposed: number;\n}): DerivedRiskSignal {\n const total = input.ownExposed + input.inheritedExposed;\n return signal({\n ref: ApplicationRiskSignalRef.EXTERNAL_EXPOSURE_MCP,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: total === 0\n ? \"The MCP transport is mounted (it is implicit for every application) and NO operation declares `mcp.exposed`, so an external agent reaches nothing through it.\"\n : `${total} operation(s) are reachable by an external agent over MCP — ${input.ownExposed} of this application's own ${input.ownOperations}, plus ${input.inheritedExposed} it inherits from the engine. The transport itself is implicit for every application and is not a choice this one made.`,\n provenance: { inputs: [\"operation.mcp.exposed on materialized resource configurations\", \"the implicit default MCP surface\"], derivation: \"per-operation declarations over the application-only and engine-inclusive registries\" },\n // Never an absence: the transport is mounted either way, so \"nothing exposed\" is an empty room\n // rather than a missing door — and the two carry different consequences.\n absent: false,\n // Sharp, unlike the transport question: an operation is reachable or it is not. An application\n // CAN avoid this exposure — by exposing nothing — and that claim is checkable.\n avoidableExposure: avoidable(total > 0, \"operations reachable by an external agent over MCP\"),\n detail: { ownExposed: input.ownExposed, ownOperations: input.ownOperations, inheritedExposed: input.inheritedExposed },\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"application-risk-signals.derivations.js","sourceRoot":"","sources":["../../../../src/assurance/application-risk-signals.derivations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAuC,MAAM,uBAAuB,CAAC;AAEtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAChK,OAAO,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAC5G,OAAO,EAAE,8BAA8B,EAAE,MAAM,iFAAiF,CAAC;AACjI,OAAO,EAAE,4BAA4B,EAAE,MAAM,uEAAuE,CAAC;AAErH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,+DAA6C,CAAA;IAC7C,6EAA2D,CAAA;AAC7D,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAiCD,SAAS,MAAM,CAAC,KAQf;IACC,OAAO;QACL,SAAS,EAAE,eAAe,KAAK,CAAC,GAAG,EAAE;QACr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AgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,MAAM,2BAA2B,CAAC,CAAC,CAAC,kDAAkD,wBAAwB,SAAS,8CAA8C;QACrS,CAAC,uBAAuB,CAAC,YAAY,CAAC,EAAE,mBAAmB,SAAS,4DAA4D;KACjI,CAAC,QAAQ,CAAC,CAAC;IACZ,OAAO,MAAM,CAAC;QACZ,GAAG,EAAE,wBAAwB,CAAC,6BAA6B;QAC3D,IAAI,EAAE,cAAc,CAAC,2BAA2B;QAChD,WAAW;QACX,UAAU;QACV,MAAM,EAAE;YACN,SAAS;YACT,QAAQ;YACR,YAAY,EAAE,SAAS,EAAE,GAAG,IAAI,IAAI;YACpC,gBAAgB,EAAE,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,+BAA+B,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;YACvG,gBAAgB;YAChB,sBAAsB,EAAE,SAAS;SAClC;QACD,iBAAiB,EAAE,SAAS,CAAC,QAAQ,KAAK,uBAAuB,CAAC,OAAO,EAAE,qDAAqD,CAAC;KAClI,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { ApplicationRiskSignalRef, type UnansweredPersonalDataResource } from \"@wildo-ai/saas-models\";\n\nimport { BrandSnapshotSchema } from \"../_core/brand/brand-snapshot.schemas\";\nimport {\n BrandNameScreeningSchema,\n deriveBrandNameTrademarkOutcome,\n uncoveredBrandNameJurisdictions,\n} from \"../_core/brand/brand-name-screening.schemas\";\nimport { BrandNameChoiceStanding, deriveBrandNameChoiceStanding, marketCompetitorNames, readCreatorBrandNameDecisions } from \"../_core/brand/brand-name-choice\";\nimport { ApplicationSpecificationFamily } from \"../_core/application-specification-family-identity.schemas\";\nimport { ApplicationCreatorInputsSchema } from \"../application-creation/application-creator-inputs.application-creation.schemas\";\nimport { resolveNotApplicableFamilies } from \"../application-creation/application-line.application-creation.schemas\";\n\n/**\n * The DERIVED risk signals (#300 Layer 1), as pure functions of what an application declares.\n *\n * ## Why they live in the engine\n *\n * They were authored in `scripts/assurance/report-risk-signals.mjs` and were reachable only there,\n * which made the `top_down.risk-register` method's derived half permanently absent: that playbook is\n * a tool-less structured generation, it says \"if signals were not supplied to this run…\", and\n * nothing has ever supplied them (#1435). The creation lane may not depend on the assurance plane —\n * `application-creation-directive.md` keeps that street one-way, and those scripts carry hard exits\n * that are right for an auditor's tool and wrong inside a run that must not stop — so the shared\n * thing had to move to where BOTH may read it. The engine is that place: every input is an engine\n * vocabulary or an application declaration, and both consumers already depend on the engine.\n *\n * The alternative was a second derivation in the companion. Rejected: two sets of observation\n * sentences about the same measurement is exactly the duplication that drifts invisibly, and the\n * script's own `assertSignalVocabularyMatches` exists because its author had already met the\n * transcription half of that problem.\n *\n * ## The one thing this layer must never become\n *\n * > *\"The derived layer emits SIGNALS with provenance, never risk conclusions. Marker density\n * > measures annotation effort, not control strength; capability enablement measures surface, not\n * > exposure severity. Auto-computing a risk SCORE from proxies recreates the false-agreement\n * > failure with more math and more confidence.\"*\n *\n * So nothing here multiplies, weights, ranks or totals a proxy into a number that reads as risk.\n * Every signal is a measured fact plus the inputs it came from; what it MEANS is Layer 3's question,\n * answered by a pass that reads the signals in context and is reviewed.\n *\n * ## The refs are the ENUM, not literals\n *\n * The script transcribed `ApplicationRiskSignalRef`'s values as string literals and guarded the\n * transcription with a two-way drift assertion. Keying on the enum removes the transcription\n * instead of checking it — the guard stays useful for the OTHER half of its job, which is refusing\n * a declared member that no signal measures.\n */\n\n/**\n * The two computation times. Never merged: a signal recomputed in the wrong home is a wrong answer\n * that looks right — the framework half needs engine SOURCE, which a deployed application cannot\n * see, and the application half needs the application's own configuration.\n */\nexport enum RiskSignalHome {\n FRAMEWORK_BUILD_TIME = \"FRAMEWORK_BUILD_TIME\",\n APPLICATION_EVALUATION_TIME = \"APPLICATION_EVALUATION_TIME\",\n}\n\n/** What a signal can contradict, where the question \"is the exposure present?\" is answerable at all. */\nexport interface AvoidableExposure {\n readonly present: boolean;\n readonly what: string;\n}\n\n/**\n * One derived signal.\n *\n * `observation` is a FACT. There is deliberately no `score`, `weight`, `level` or `severity` field —\n * adding one is how this layer stops being a derivation and starts being an unreviewed conclusion.\n */\nexport interface DerivedRiskSignal {\n readonly signalRef: string;\n readonly home: RiskSignalHome;\n readonly observation: string;\n readonly provenance: { readonly inputs?: readonly string[]; readonly derivation?: string };\n /** A COMPUTED absence — the exposure is structurally not there — never \"nobody wrote it down\". */\n readonly absent: boolean;\n readonly detail: unknown;\n /**\n * `{ present, what }` where the question is answerable, `null` where it is not — and the null is a\n * decision rather than an omission. \"Is the exposure present?\" is sharp for a vendor-hosted\n * provider or an operation reachable over MCP, and genuinely ambiguous for the capability surface\n * (is an ENABLED capability an exposure, or is a disabled one an absence?) and for the\n * personal-data inventory (every application processes some personal data; the exposure is which\n * kind, not whether).\n */\n readonly avoidableExposure: AvoidableExposure | null;\n}\n\nfunction signal(input: {\n ref: ApplicationRiskSignalRef;\n home: RiskSignalHome;\n observation: string;\n provenance: DerivedRiskSignal[\"provenance\"];\n absent?: boolean;\n detail?: unknown;\n avoidableExposure?: AvoidableExposure | null;\n}): DerivedRiskSignal {\n return {\n signalRef: `risk-signal:${input.ref}`,\n home: input.home,\n observation: input.observation,\n provenance: input.provenance,\n absent: input.absent ?? false,\n detail: input.detail ?? null,\n avoidableExposure: input.avoidableExposure ?? null,\n };\n}\n\nconst avoidable = (present: boolean, what: string): AvoidableExposure => ({ present, what });\n\n/**\n * Which engine capabilities this application turned on — TOTAL over the vocabulary.\n *\n * Total rather than a list of what is enabled, following `undeclaredRetentionClasses`' pattern: a\n * capability added to the vocabulary tomorrow is reported as not-enabled by every existing\n * application rather than silently omitted. The DISABLED half is the part a static register cannot\n * state — a capability that is off forecloses the exposures that ride it.\n */\nexport function deriveCapabilitySignal(input: { enabledRefs: ReadonlySet<string>; allRefs: readonly string[] }): DerivedRiskSignal {\n const enabled = [...input.enabledRefs].sort();\n const disabled = input.allRefs.filter((ref) => !input.enabledRefs.has(ref)).sort();\n return signal({\n ref: ApplicationRiskSignalRef.CAPABILITY_SURFACE,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: `${enabled.length} of ${input.allRefs.length} engine capabilities are enabled; ${disabled.length} are off and the exposures that ride them are structurally absent.`,\n provenance: { inputs: [\"wildo.saas.config.ts engineCapabilities\", \"EngineCapability vocabulary\"], derivation: \"total over the vocabulary, enabled vs not\" },\n detail: { enabled, disabled },\n });\n}\n\n/**\n * Which retention classes the application declared a period for, and which it has not.\n *\n * Reuses the engine's OWN `undeclaredRetentionClasses` rather than re-deriving it: a predicate\n * re-implemented in a script drifts, and the evidence would then describe the script.\n */\nexport function deriveRetentionSignal(input: { declaredClasses: readonly string[]; undeclared: readonly string[] }): DerivedRiskSignal {\n return signal({\n ref: ApplicationRiskSignalRef.RETENTION_DECLARATION,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: input.undeclared.length === 0\n ? `Every retention class the vocabulary carries has a declared period (${input.declaredClasses.length}).`\n : `${input.declaredClasses.length} retention class(es) declared, ${input.undeclared.length} with no declared period.`,\n provenance: { inputs: [\"the application ApplicationRetentionSchedule\", \"DataRetentionClass vocabulary\"], derivation: \"engine undeclaredRetentionClasses\" },\n absent: input.undeclared.length === 0,\n avoidableExposure: avoidable(input.undeclared.length > 0, \"retention classes with no declared period\"),\n detail: { declared: input.declaredClasses, undeclared: input.undeclared },\n });\n}\n\n/**\n * Vendor-hosted versus self-hosted providers — the third-party-processor exposure.\n *\n * #300's own example of a computed absence: an application with no vendor-hosted provider has NO\n * third-party-processor exposure, and a static register cannot honestly say that — it can only fail\n * to mention it.\n *\n * UNDECLARED is not ABSENT, and conflating them is the one way this signal can lie. The compliance\n * choice is an operator DECLARATION (`deploymentModel`), required even when a provider supports only\n * one model, because whether personal data leaves the operator's control is the single most\n * consequential fact a notice states about a provider. A provider that declares nothing has not told\n * us it is self-hosted; it has told us nothing. Reporting zero vendor-hosted providers as a computed\n * absence there would turn a MISSING DECLARATION into evidence of no exposure — the exact inversion\n * this derived layer exists to avoid, and the more dangerous one, because a static register at least\n * cannot claim it.\n *\n * Measured on Wonder Todos, which is why this paragraph exists: its three configured providers\n * include two obvious vendor-hosted LLM APIs and declare no deployment model at all. An earlier\n * version reported \"third-party-processor exposure is computed ABSENT\".\n */\nexport function deriveProviderHostingSignal(input: {\n vendorHosted: readonly string[];\n selfHosted: readonly string[];\n undeclared: readonly string[];\n}): DerivedRiskSignal {\n const total = input.vendorHosted.length + input.selfHosted.length + input.undeclared.length;\n const detail = { vendorHosted: input.vendorHosted, selfHosted: input.selfHosted, undeclared: input.undeclared };\n if (input.undeclared.length > 0) {\n return signal({\n ref: ApplicationRiskSignalRef.PROVIDER_HOSTING,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: `${input.undeclared.length} of ${total} configured provider(s) declare no deployment model, so third-party-processor exposure is UNDETERMINED — an undeclared choice is not a computed absence.`,\n provenance: { inputs: [\"the application providerComplianceChoices\", \"the application providerConfigurations as the configured population\"], derivation: \"engine vendorHostedProviderRefs, and the configured providers it names nothing for\" },\n absent: false,\n // UNDETERMINED, so the avoidable question is unanswerable here: treating it as 'exposure\n // absent' would let a declared posture of AVOIDED pass unchallenged on exactly the\n // application that declared nothing.\n avoidableExposure: null,\n detail,\n });\n }\n return signal({\n ref: ApplicationRiskSignalRef.PROVIDER_HOSTING,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: input.vendorHosted.length === 0\n ? `Every configured provider (${total}) declares a deployment model and NONE is vendor-hosted, so third-party-processor exposure is computed ABSENT rather than unstated.`\n : `${input.vendorHosted.length} of ${total} configured provider(s) are vendor-hosted, each a third-party processor.`,\n provenance: { inputs: [\"the application providerComplianceChoices\"], derivation: \"engine vendorHostedProviderRefs\" },\n absent: input.vendorHosted.length === 0,\n avoidableExposure: avoidable(input.vendorHosted.length > 0, \"vendor-hosted providers, each a third-party processor\"),\n detail,\n });\n}\n\n/**\n * Which personal-data categories this application's OWN resources declare, totalled over the vocabulary.\n *\n * Derived from the application's schemas rather than from anything anyone typed about them:\n * `resolveResourcePersonalDataCategories` reads the `.dataCategories()` declarations off each\n * resource's main schema, which is the same source the subject-export and impersonalization\n * machinery reads.\n *\n * SPECIAL CATEGORY is reported separately and deliberately. It is not \"more\" personal data on a\n * scale — it is data that needs a condition beyond the ordinary lawful basis before it may be\n * processed at all, so folding it into a count would lose the only distinction that changes what an\n * operator must have. Still a SIGNAL: that special-category data is declared is a fact, not a finding.\n *\n * Engine resources are excluded from the denominator on the engine's own reasoning: an application\n * author cannot change their posture, and including them would put permanent entries in front of\n * every reader of a report about THEIR application.\n */\nexport function derivePersonalDataSignals(input: {\n declaredCategories: readonly string[];\n allCategories: readonly string[];\n specialCategories: readonly string[];\n /**\n * The resources that said nothing, as `collectApplicationResourcesWithNoPersonalDataDeclaration`\n * returns them — carried through to `detail` whole rather than counted away, because WHICH\n * resources are silent is the only actionable half of this signal.\n */\n unanswered: readonly UnansweredPersonalDataResource[];\n applicationResourceCount: number;\n}): readonly DerivedRiskSignal[] {\n const declared = [...new Set(input.declaredCategories)].sort();\n const undeclared = input.allCategories.filter((category) => !declared.includes(category)).sort();\n const special = declared.filter((category) => input.specialCategories.includes(category)).sort();\n return [\n signal({\n ref: ApplicationRiskSignalRef.PERSONAL_DATA_INVENTORY,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: declared.length === 0\n ? `No application resource declares a personal-data category (${input.allCategories.length} in the vocabulary), so the data-sensitivity surface is UNDECLARED rather than empty.`\n : `${declared.length} of ${input.allCategories.length} personal-data categories are declared across this application's own resources; ${undeclared.length} are not present.`\n + (special.length === 0 ? \" None is a special category.\" : ` ${special.length} of them are SPECIAL CATEGORY, which needs a processing condition beyond the ordinary lawful basis.`),\n provenance: { inputs: [\".dataCategories() declarations on application resource schemas\", \"PersonalDataCategory vocabulary\"], derivation: \"engine resolveResourcePersonalDataCategories, totalled over the vocabulary\" },\n // Never an absence: nothing declared means nobody said, which is the opposite of nothing held.\n absent: false,\n detail: { declared, undeclared, specialCategory: special },\n }),\n signal({\n ref: ApplicationRiskSignalRef.PERSONAL_DATA_DECLARATION_GAP,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: input.unanswered.length === 0\n ? `All ${input.applicationResourceCount} of this application's own resources have answered the personal-data question.`\n : `${input.unanswered.length} of ${input.applicationResourceCount} of this application's own resources have said NOTHING about personal data — no retention treatment, no data-subject policy, no subject-export posture and no declared category.`,\n provenance: { inputs: [\"application resource configurations\"], derivation: \"engine collectApplicationResourcesWithNoPersonalDataDeclaration\" },\n absent: input.unanswered.length === 0,\n avoidableExposure: avoidable(input.unanswered.length > 0, \"resources that have said nothing about personal data\"),\n detail: input.unanswered,\n }),\n ];\n}\n\n/**\n * What an external agent can reach through the MCP transport.\n *\n * \"External-client risk classes present or structurally absent\" needed correcting against the code\n * before it could be derived. **The default `/mcp` and `/a2a` transports are mounted for EVERY\n * application** — the resource-server registry says so at its own site — so the transport is never\n * structurally absent and an application never chose it.\n *\n * What an application DOES choose is what is reachable through it: `mcp: { exposed: true }` on a\n * resource OPERATION, which is the whole of it. Zero exposed operations is therefore a real and\n * useful answer: the door is open and the room is empty.\n *\n * Engine and application operations are counted apart for the same reason the personal-data gap\n * separates them — an application author chooses one set and inherits the other — but BOTH are\n * reported, because an external agent reaches whatever is exposed regardless of who declared it.\n */\nexport function deriveMcpExposureSignal(input: {\n ownExposed: number;\n ownOperations: number;\n inheritedExposed: number;\n}): DerivedRiskSignal {\n const total = input.ownExposed + input.inheritedExposed;\n return signal({\n ref: ApplicationRiskSignalRef.EXTERNAL_EXPOSURE_MCP,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: total === 0\n ? \"The MCP transport is mounted (it is implicit for every application) and NO operation declares `mcp.exposed`, so an external agent reaches nothing through it.\"\n : `${total} operation(s) are reachable by an external agent over MCP — ${input.ownExposed} of this application's own ${input.ownOperations}, plus ${input.inheritedExposed} it inherits from the engine. The transport itself is implicit for every application and is not a choice this one made.`,\n provenance: { inputs: [\"operation.mcp.exposed on materialized resource configurations\", \"the implicit default MCP surface\"], derivation: \"per-operation declarations over the application-only and engine-inclusive registries\" },\n // Never an absence: the transport is mounted either way, so \"nothing exposed\" is an empty room\n // rather than a missing door — and the two carry different consequences.\n absent: false,\n // Sharp, unlike the transport question: an operation is reachable or it is not. An application\n // CAN avoid this exposure — by exposing nothing — and that claim is checkable.\n avoidableExposure: avoidable(total > 0, \"operations reachable by an external agent over MCP\"),\n detail: { ownExposed: input.ownExposed, ownOperations: input.ownOperations, inheritedExposed: input.inheritedExposed },\n });\n}\n\n/**\n * Where the brand's chosen NAME stands against its minimal trademark screening.\n *\n * Takes the RAW landed values (brand, screening, market, dossier) and parses them itself, so the companion\n * and the assurance report — the two homes that read this — cannot compute it differently. Standing comes\n * from `deriveBrandNameChoiceStanding`, the same function the coherence report and the brand-name choice use.\n *\n * - The line carries no brand (an internal tool): a COMPUTED absence.\n * - No brand name yet: nothing to be exposed by, and not an absence either — the name is still to come.\n * - Cleared: screened in every declared jurisdiction and class with no conflict found. Still a screening, not\n * a clearance, which the observation says.\n * - Screening incomplete, kept despite a conflict, or never screened: the exposure is PRESENT, with the\n * conflicting marks or the uncovered jurisdictions in `detail`.\n */\nexport function deriveBrandNameTrademarkSignal(input: {\n readonly brand: unknown;\n readonly screening: unknown;\n readonly market: unknown;\n readonly creatorInputs: unknown;\n}): DerivedRiskSignal {\n const provenance = {\n inputs: [\"brand-brief (name)\", \"brand-name-screening\", \"market-snapshot (alternatives)\", \"creator-inputs (application line)\"],\n derivation: \"the brand name matched to its screened candidate; standing derived from the candidate's register queries\",\n };\n const dossier = ApplicationCreatorInputsSchema.safeParse(input.creatorInputs);\n if (resolveNotApplicableFamilies(dossier.success ? dossier.data : undefined).has(ApplicationSpecificationFamily.BRAND_BRIEF)) {\n return signal({\n ref: ApplicationRiskSignalRef.BRAND_NAME_TRADEMARK_STANDING,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: \"This application's line carries no brand, so there is no brand name to screen.\",\n provenance,\n absent: true,\n avoidableExposure: avoidable(false, \"a brand name not cleared by its trademark screening\"),\n });\n }\n const brand = BrandSnapshotSchema.safeParse(input.brand);\n if (!brand.success) {\n return signal({\n ref: ApplicationRiskSignalRef.BRAND_NAME_TRADEMARK_STANDING,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation: \"No brand name has been chosen yet, so there is no name to stand against a trademark screening.\",\n provenance,\n avoidableExposure: avoidable(false, \"a brand name not cleared by its trademark screening\"),\n });\n }\n const parsedScreening = BrandNameScreeningSchema.safeParse(input.screening);\n const screening = parsedScreening.success ? parsedScreening.data : undefined;\n const alternatives = (input.market as { alternatives?: Parameters<typeof marketCompetitorNames>[0] } | undefined)?.alternatives;\n const brandName = brand.data.name.brandName;\n const { standing, candidate } = deriveBrandNameChoiceStanding({\n brandName,\n screening,\n competitorNames: marketCompetitorNames(alternatives),\n chosenBrandNameAnswer: readCreatorBrandNameDecisions(dossier.success ? dossier.data : undefined).chosenBrandNameAnswer,\n });\n const conflictingMarks = (candidate?.trademarkQueries ?? []).flatMap((query) => query.conflictingMarks.map((mark) => ({ mark: mark.mark, register: query.register, status: mark.status, sourceUrl: mark.sourceUrl })));\n const uncovered = screening && candidate ? [...uncoveredBrandNameJurisdictions(screening, candidate)] : [];\n const observation = {\n [BrandNameChoiceStanding.CLEARED]: `The brand name \"${brandName}\" was screened in every declared jurisdiction and class with no live conflicting mark found — a minimal screening, not a legal clearance.`,\n [BrandNameChoiceStanding.SCREENING_INCOMPLETE]: `The brand name \"${brandName}\" was screened incompletely: not cleared in ${uncovered.join(\", \") || \"a register that could not be read\"}.`,\n [BrandNameChoiceStanding.KEPT_DESPITE_CONFLICT]: `The brand name \"${brandName}\" was kept although its screening found ${conflictingMarks.length > 0 ? `${conflictingMarks.length} live conflicting mark(s)` : \"a named competitor with the same or a close name\"}.`,\n [BrandNameChoiceStanding.CONFLICT_UNACKNOWLEDGED]: `The screening now finds ${conflictingMarks.length > 0 ? `${conflictingMarks.length} live conflicting mark(s)` : \"a named competitor with the same or a close name\"} for the brand name \"${brandName}\", and nobody chose to keep it despite that.`,\n [BrandNameChoiceStanding.NOT_SCREENED]: `The brand name \"${brandName}\" has never been screened against the trademark registers.`,\n }[standing];\n return signal({\n ref: ApplicationRiskSignalRef.BRAND_NAME_TRADEMARK_STANDING,\n home: RiskSignalHome.APPLICATION_EVALUATION_TIME,\n observation,\n provenance,\n detail: {\n brandName,\n standing,\n candidateRef: candidate?.ref ?? null,\n trademarkOutcome: screening && candidate ? deriveBrandNameTrademarkOutcome(screening, candidate) : null,\n conflictingMarks,\n uncoveredJurisdictions: uncovered,\n },\n avoidableExposure: avoidable(standing !== BrandNameChoiceStanding.CLEARED, \"a brand name not cleared by its trademark screening\"),\n });\n}\n"]}
|
|
@@ -3,6 +3,15 @@ import { type ApplicationDocumentReleasePolicySelectionV1 } from "../application
|
|
|
3
3
|
import { type ComplianceDocumentCandidate } from "../_core/compliance-documents/compliance-document-candidate.schemas";
|
|
4
4
|
import type { AssuranceDocumentPublicationVariant } from "./application-document-publication.schemas";
|
|
5
5
|
import type { AssuranceDocumentDefinition } from "./assurance-document-system.schemas";
|
|
6
|
+
/**
|
|
7
|
+
* Where `wildo config document-releases` writes the runtime releases module, relative to the application root — the
|
|
8
|
+
* module `saas-config.backend.ts` composes into `compliance.governedDocumentReleases` (the registration acceptance
|
|
9
|
+
* control) and `compliance.publicDocuments`. Beside `brand-assets.generated.ts`.
|
|
10
|
+
*
|
|
11
|
+
* Here rather than in the CLI generator because two processes read it: the generator writes it, and the companion's
|
|
12
|
+
* launch list reads whether it exists (#2238). The `SUBJECT_DATA_RECIPIENTS_GENERATED_RELATIVE_PATH` precedent.
|
|
13
|
+
*/
|
|
14
|
+
export declare const GOVERNED_DOCUMENT_RELEASES_GENERATED_RELATIVE_PATH = "backend-api/src/governed-document-releases.generated.ts";
|
|
6
15
|
/** Validating form of the draft-to-public-text projection. Throws when the result is not valid public content. */
|
|
7
16
|
export declare function projectComplianceDocumentCandidatePublicContent(candidate: ComplianceDocumentCandidate, publication: {
|
|
8
17
|
readonly locale: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"governed-document-release.d.ts","sourceRoot":"","sources":["../../../../src/assurance/governed-document-release.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,wCAAwC,EAE7C,KAAK,2CAA2C,EAChD,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACrC,MAAM,uBAAuB,CAAC;AAgB/B,OAAO,EAEL,KAAK,2CAA2C,EACjD,MAAM,wGAAwG,CAAC;AAChH,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,qEAAqE,CAAC;AAC7E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,4CAA4C,CAAC;AAEtG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AA+
|
|
1
|
+
{"version":3,"file":"governed-document-release.d.ts","sourceRoot":"","sources":["../../../../src/assurance/governed-document-release.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,wCAAwC,EAE7C,KAAK,2CAA2C,EAChD,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACrC,MAAM,uBAAuB,CAAC;AAgB/B,OAAO,EAEL,KAAK,2CAA2C,EACjD,MAAM,wGAAwG,CAAC;AAChH,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,qEAAqE,CAAC;AAC7E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,4CAA4C,CAAC;AAEtG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,kDAAkD,4DAA4D,CAAC;AA+C5H,kHAAkH;AAClH,wBAAgB,+CAA+C,CAC7D,SAAS,EAAE,2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,EAAE,SAAS,uBAAuB,EAAE,EAC5C,KAAK,EAAE,4BAA4B,GAClC,uBAAuB,GAAG,SAAS,CAiBrC;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,SAAS,uBAAuB,EAAE,GAC3C,uBAAuB,GAAG,SAAS,CAOrC;AACD,oFAAoF"}
|
|
@@ -16,6 +16,15 @@ import { GOVERNED_DOCUMENT_PUBLIC_CONTENT_MEDIA_TYPE, governedDocumentReleaseIsI
|
|
|
16
16
|
import { ApplicationDocumentReleasePolicyLane, } from "../application-creation/application-document-release-policy-specification.application-creation.schemas.js";
|
|
17
17
|
import { ComplianceStatementCompleteness, } from "../_core/compliance-documents/compliance-document-candidate.schemas.js";
|
|
18
18
|
import { assuranceDocumentPublicationVariantKey } from "./application-document-publication.schemas.js";
|
|
19
|
+
/**
|
|
20
|
+
* Where `wildo config document-releases` writes the runtime releases module, relative to the application root — the
|
|
21
|
+
* module `saas-config.backend.ts` composes into `compliance.governedDocumentReleases` (the registration acceptance
|
|
22
|
+
* control) and `compliance.publicDocuments`. Beside `brand-assets.generated.ts`.
|
|
23
|
+
*
|
|
24
|
+
* Here rather than in the CLI generator because two processes read it: the generator writes it, and the companion's
|
|
25
|
+
* launch list reads whether it exists (#2238). The `SUBJECT_DATA_RECIPIENTS_GENERATED_RELATIVE_PATH` precedent.
|
|
26
|
+
*/
|
|
27
|
+
export const GOVERNED_DOCUMENT_RELEASES_GENERATED_RELATIVE_PATH = "backend-api/src/governed-document-releases.generated.ts";
|
|
19
28
|
/**
|
|
20
29
|
* The public text a draft becomes — what a release carries, and what a page shows for a document
|
|
21
30
|
* that was never released (wildo-ai/wildo-ai#968).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"governed-document-release.js","sourceRoot":"","sources":["../../../../src/assurance/governed-document-release.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,gCAAgC,EAChC,oCAAoC,EACpC,mCAAmC,EAC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AAK,CAAC;YAAE,OAAO,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;QACnE,OAAO,SAAS,CAAC,QAAQ,CAAC,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACjG,CAAC,CAAC,CAAC;AACL,CAAC;AACD,oFAAoF","sourcesContent":["import {\n GOVERNED_DOCUMENT_PUBLIC_CONTENT_MEDIA_TYPE,\n governedDocumentReleaseIsInForce,\n GovernedDocumentPublicClauseStanding,\n GovernedDocumentPublicContentSchema,\n GovernedDocumentReleaseApprovalState,\n GovernedDocumentReleaseSchema,\n type GovernedDocumentApprovalDecisionIdentity,\n type GovernedDocumentGovernanceSubjectKind,\n type GovernedDocumentMaterialityDecisionIdentity,\n type GovernedDocumentPublicContent,\n type GovernedDocumentRelease,\n type GovernedDocumentReleaseIdentity,\n} from \"@wildo-ai/saas-models\";\n\n/*\n * CROSSING into `application-creation/`, deliberately and in the established direction — two\n * `*.family-aspects.ts` files here already do it, and nothing in `application-creation/` imports\n * back. The release POLICY is the thing that decides whether releasing is permitted at all, so a\n * composer that could not see it would be the hole rather than the fix.\n *\n * Known shape, stated rather than left implicit: `GovernedDocumentReleaseComposition` is exported\n * from the `assurance` subpath and reaches `ApplicationDocumentReleasePolicyLane`, a NOMINAL enum\n * that subpath does not publish (the ROOT and `application-creation` do). `check:package-entrypoints`\n * reports no finding for this file, and in practice a caller cannot HOLD a policy selection without\n * having resolved the `application-creation` surface that owns the family — there is nowhere else to\n * obtain one. If rule 7 ever does report it, the answer is the root-only probe that rule prescribes,\n * not a re-export: a second door onto one room is what `root-barrel-overlap` refuses.\n */\nimport {\n ApplicationDocumentReleasePolicyLane,\n type ApplicationDocumentReleasePolicySelectionV1,\n} from \"../application-creation/application-document-release-policy-specification.application-creation.schemas\";\nimport {\n ComplianceStatementCompleteness,\n type ComplianceDocumentCandidate,\n} from \"../_core/compliance-documents/compliance-document-candidate.schemas\";\nimport type { AssuranceDocumentPublicationVariant } from \"./application-document-publication.schemas\";\nimport { assuranceDocumentPublicationVariantKey } from \"./application-document-publication.schemas\";\nimport type { AssuranceDocumentDefinition } from \"./assurance-document-system.schemas\";\n\n/**\n * The public text a draft becomes — what a release carries, and what a page shows for a document\n * that was never released (wildo-ai/wildo-ai#968).\n *\n * An ALLOW-LIST, like every other public projection in this lane. A candidate clause carries fact\n * refs, source-policy refs, claim-guard refs, blueprint joins and — when it is incomplete — who closes\n * the gap and how (`closedBy`: issue refs, owners). None of that is the reader's. What survives is the\n * structure (sections and clauses, by ref and order), the prose, and the clause's STANDING: a clause\n * the drafter could not establish is marked `NOT_YET_ESTABLISHED` with the drafter's own `needs` text,\n * never passed off as settled and never dropped.\n *\n * The language and jurisdictions come from the PUBLICATION, not the draft: a candidate may leave both\n * open, and the release (or the application's declared variant, for an unreleased draft) is what\n * decides them. The composer refuses a candidate that contradicts its variant before this runs.\n *\n * Returns the unparsed shape so the composer can validate it inside the release record and report a\n * failure as an issue; {@link projectComplianceDocumentCandidatePublicContent} is the validating form.\n */\nfunction draftPublicContent(\n candidate: ComplianceDocumentCandidate,\n publication: { readonly locale: string; readonly jurisdictionRefs: readonly string[] },\n) {\n return {\n schemaVersion: 1 as const,\n title: candidate.title,\n locale: publication.locale,\n jurisdictionRefs: [...publication.jurisdictionRefs],\n sections: candidate.sections.map((section) => ({\n sectionRef: section.sectionRef,\n order: section.order,\n title: section.title,\n clauses: section.clauses.map((clause) =>\n clause.completeness === ComplianceStatementCompleteness.DERIVED\n ? { clauseRef: clause.clauseRef, order: clause.order, bodyMarkdown: clause.bodyMarkdown, standing: GovernedDocumentPublicClauseStanding.ESTABLISHED }\n : {\n clauseRef: clause.clauseRef,\n order: clause.order,\n bodyMarkdown: clause.bodyMarkdown,\n standing: GovernedDocumentPublicClauseStanding.NOT_YET_ESTABLISHED,\n missingInformation: clause.incompleteness?.needs,\n }),\n })),\n };\n}\n\n/** Validating form of the draft-to-public-text projection. Throws when the result is not valid public content. */\nexport function projectComplianceDocumentCandidatePublicContent(\n candidate: ComplianceDocumentCandidate,\n publication: { readonly locale: string; readonly jurisdictionRefs: readonly string[] },\n): GovernedDocumentPublicContent {\n return GovernedDocumentPublicContentSchema.parse(draftPublicContent(candidate, publication));\n}\n\n/**\n * @wildo_source:part:start saas.specifications.governed-document-release.contract facet:layer:specification facet:family:assurance\n *\n * Turning an APPROVED DRAFT into a RELEASE — the step whose absence meant a\n * drafted governed document could never become a published one (issue #245).\n *\n * The lane could draft: an application holds a real\n * `ComplianceDocumentCandidate` with its sections, clauses and prose. What it\n * had no way to do was say *this draft, in this language, for these\n * jurisdictions, is approved and takes effect on this date* — measured\n * 2026-09-02 and re-measured 2026-09-11, `GovernedDocumentReleaseSchema`\n * appeared in exactly two files, its own definition and its unit test, and\n * nothing anywhere constructed one.\n *\n * **This is a composition, not a custody protocol, and the distinction is the\n * whole design.** `0924c256` removed the previous publication lane — \"a sealed\n * machine that had never run\" — and said what should replace it: *\"A governed\n * document is a file; publishing one is a commit. When an application has a\n * document to serve, serving is rebuilt from files — a read, not a custody\n * protocol.\"* So there is no bundle here, no digest, no content-addressed\n * store and no byte-exact retrieval transport. A release is a record an\n * application COMMITS, and {@link resolveEffectiveDocumentRelease} is the read.\n *\n * **Most of a release is DERIVED rather than authored**, which is the other\n * half of the design. The accepted `AssuranceDocumentDefinition` already\n * decides the document's class, who it addresses, which channels may carry it\n * and which interactions it permits — so asking an author to restate them\n * would invite five ways to disagree with the catalog, and the disagreement\n * would be invisible. What is genuinely a human decision is the narrow part:\n * which draft, which variant, which approval, and when it takes effect.\n */\nexport enum GovernedDocumentReleaseCompositionIssueKind {\n /** The candidate drafts a different document from the one being released. */\n CANDIDATE_DOCUMENT_MISMATCH = \"CANDIDATE_DOCUMENT_MISMATCH\",\n /** The requested variant is not one the application declared it publishes in. */\n VARIANT_NOT_PUBLISHED = \"VARIANT_NOT_PUBLISHED\",\n /** The candidate states a locale or jurisdictions that contradict the variant being released. */\n CANDIDATE_VARIANT_CONTRADICTION = \"CANDIDATE_VARIANT_CONTRADICTION\",\n /** The governance subject is not one the document's definition governs. */\n GOVERNANCE_SUBJECT_NOT_PERMITTED = \"GOVERNANCE_SUBJECT_NOT_PERMITTED\",\n /** A release that replaces another must supersede the SAME document. */\n REPLACES_DIFFERENT_DOCUMENT = \"REPLACES_DIFFERENT_DOCUMENT\",\n /** The release policy consulted governs a different document from the one being released. */\n RELEASE_POLICY_FOR_OTHER_REQUIREMENT = \"RELEASE_POLICY_FOR_OTHER_REQUIREMENT\",\n /** The composed record does not satisfy `GovernedDocumentReleaseSchema`. */\n RELEASE_RECORD_INVALID = \"RELEASE_RECORD_INVALID\",\n}\n\nexport interface GovernedDocumentReleaseCompositionIssue {\n readonly kind: GovernedDocumentReleaseCompositionIssueKind;\n readonly message: string;\n}\n\n/**\n * What is TRUE about a composed release that a human must eventually act on — never a reason to\n * refuse composing it.\n *\n * The split from {@link GovernedDocumentReleaseCompositionIssueKind} is the design, not a severity\n * scale. An ISSUE means the record would be FALSE: it names a document the candidate does not draft,\n * or publishes an `en-GB` draft as `fr-FR`. An ADVISORY means the record is TRUE and the workflow is\n * not finished — nobody has approved it yet, or the application's own policy keeps this document in\n * the draft-only lane.\n *\n * Wildo is agent-first, so the second kind may never stop the mechanism. A compliance workflow\n * standing in front of application creation is exactly the shape this framework refuses: the system\n * must WORK first, and\n * restrictions arrive later as judge-style guards rather than ceremony wired into the mechanism.\n */\nexport enum GovernedDocumentReleaseAdvisoryKind {\n /** Composed without an approval decision. The release says so in `approvalState`. */\n NOT_APPROVED = \"NOT_APPROVED\",\n /**\n * The application's accepted policy keeps this document in the DRAFT_ONLY lane.\n *\n * It refused composition until 2026-09-11, and that was the error this whole split corrects: a\n * lane an application chose for its OWN document became a wall in front of its own build. The\n * release is composed, marked UNAPPROVED, and the lane is reported — so the decision to serve it\n * is taken where serving happens, which is Gate 3's to arm.\n */\n POLICY_IS_DRAFT_ONLY = \"POLICY_IS_DRAFT_ONLY\",\n}\n\nexport interface GovernedDocumentReleaseAdvisory {\n readonly kind: GovernedDocumentReleaseAdvisoryKind;\n readonly message: string;\n}\n\n/** What a human actually decides. Everything else on the record is derived from the accepted definition. */\nexport interface GovernedDocumentReleaseComposition {\n /** The framework-accepted definition. Supplies class, audiences, channels and permitted interactions. */\n readonly definition: AssuranceDocumentDefinition;\n /** The approved draft whose content this release publishes. */\n readonly candidate: ComplianceDocumentCandidate;\n /** The exact locale x jurisdiction combination being published. */\n readonly variant: AssuranceDocumentPublicationVariant;\n /** Every variant the application declared it publishes in; the variant above must be one of them. */\n readonly publishedVariants: readonly AssuranceDocumentPublicationVariant[];\n /**\n * The application's accepted release-policy selection for THIS document's requirement.\n *\n * REQUIRED, because releasing is the act that policy exists to govern. `DRAFT_ONLY` means the\n * document \"may be generated and retained, but cannot be released or published\" — a sentence with\n * no effect unless something refuses, and the only place that can refuse is here. An optional\n * input would have made the strictest lane the easiest one to skip: omit the field, get a release.\n *\n * The other two lanes do not branch here. Whether an operator attestation or a qualified review\n * actually happened is recorded in `approvalDecisions`, and the selection's own schema already\n * requires an attested lane to carry its explicit limitations.\n */\n readonly releasePolicy: ApplicationDocumentReleasePolicySelectionV1;\n /** The requirement the policy must govern — the join is by requirement, never by document ref. */\n readonly requirement: { readonly requirementRef: string; readonly requirementVersion: number };\n readonly identity: GovernedDocumentReleaseIdentity;\n readonly governanceScope: GovernedDocumentRelease[\"governanceScope\"];\n /**\n * The approvals retained for this release, if any yet.\n *\n * EMPTY is a first-class answer, not a missing input: it composes an UNAPPROVED release and an\n * advisory saying so. Requiring one here would mean an application could only hold a release by\n * forging an approval identity, which is worse than having none.\n */\n readonly approvalDecisions: readonly GovernedDocumentApprovalDecisionIdentity[];\n readonly issuedAt: string;\n readonly effectiveAt: string;\n readonly expiresAt?: string;\n /**\n * Superseding another release, stated ONCE as the materiality decision.\n *\n * The release record carries both `replacesRelease` and `materialityDecision`, and its schema\n * requires them to be present together AND to name the same previous release. So the caller gives\n * the decision and `replacesRelease` is DERIVED from `previousRelease` — two fields that must\n * agree are not two decisions, and asking for both would only create a way to disagree.\n *\n * The decision itself is the governance question a replacement owes: did the change matter enough\n * that the audience must meet the document again? `requiredInteractionKinds` is where that lands.\n */\n readonly supersedes?: GovernedDocumentMaterialityDecisionIdentity;\n}\nconst sorted = (values: readonly string[]): string[] => [...values].sort();\nconst sameSet = (left: readonly string[], right: readonly string[]): boolean =>\n left.length === right.length && sorted(left).every((value, index) => value === sorted(right)[index]);\n\n/**\n * Compose one release, or report why the parts do not agree.\n *\n * Returns issues rather than throwing, following the `_core` validator convention: a caller\n * assembling several releases wants all the disagreements at once, not the first one.\n */\nexport function composeGovernedDocumentRelease(\n composition: GovernedDocumentReleaseComposition,\n): {\n readonly release: GovernedDocumentRelease | undefined;\n readonly issues: readonly GovernedDocumentReleaseCompositionIssue[];\n readonly advisories: readonly GovernedDocumentReleaseAdvisory[];\n} {\n const issues: GovernedDocumentReleaseCompositionIssue[] = [];\n const advisories: GovernedDocumentReleaseAdvisory[] = [];\n const { candidate, variant, identity, definition } = composition;\n\n if (candidate.documentRef !== identity.document.documentRef) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.CANDIDATE_DOCUMENT_MISMATCH,\n message: `candidate drafts \"${candidate.documentRef}\" but the release identifies \"${identity.document.documentRef}\"`,\n });\n }\n\n if (composition.releasePolicy.requirementRef !== composition.requirement.requirementRef\n || composition.releasePolicy.requirementVersion !== composition.requirement.requirementVersion) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.RELEASE_POLICY_FOR_OTHER_REQUIREMENT,\n message: `release policy governs \"${composition.releasePolicy.requirementRef}@${composition.releasePolicy.requirementVersion}\" `\n + `but this release is for \"${composition.requirement.requirementRef}@${composition.requirement.requirementVersion}\"`,\n });\n }\n if (composition.releasePolicy.lane === ApplicationDocumentReleasePolicyLane.DRAFT_ONLY) {\n advisories.push({\n kind: GovernedDocumentReleaseAdvisoryKind.POLICY_IS_DRAFT_ONLY,\n message: `the accepted release policy puts \"${composition.requirement.requirementRef}\" in the DRAFT_ONLY lane: compose and retain it, but nothing may serve it as published`,\n });\n }\n\n const variantKey = assuranceDocumentPublicationVariantKey(variant);\n if (!composition.publishedVariants.some((published) => assuranceDocumentPublicationVariantKey(published) === variantKey)) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.VARIANT_NOT_PUBLISHED,\n message: `variant \"${variantKey}\" is not among the variants the application declared it publishes in`,\n });\n }\n\n /*\n * A candidate MAY leave locale and jurisdictions open — that is deliberate upstream, so a draft can\n * exist before the routing decision. What it may not do is state them and DISAGREE: releasing an\n * `en-GB` draft as the `fr-FR` variant would publish text under a claim it does not make.\n */\n if (candidate.locale !== undefined && candidate.locale !== variant.locale) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.CANDIDATE_VARIANT_CONTRADICTION,\n message: `candidate states locale \"${candidate.locale}\" but the release publishes \"${variant.locale}\"`,\n });\n }\n if (candidate.jurisdictionRefs !== undefined && !sameSet(candidate.jurisdictionRefs, variant.jurisdictionRefs)) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.CANDIDATE_VARIANT_CONTRADICTION,\n message: `candidate states jurisdictions [${sorted(candidate.jurisdictionRefs).join(\", \")}] but the release publishes [${sorted(variant.jurisdictionRefs).join(\", \")}]`,\n });\n }\n\n if (!definition.governanceSubjectKinds.includes(composition.governanceScope.subjectKind as GovernedDocumentGovernanceSubjectKind)) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.GOVERNANCE_SUBJECT_NOT_PERMITTED,\n message: `definition \"${definition.identity.definitionRef}\" governs [${definition.governanceSubjectKinds.join(\", \")}], not \"${composition.governanceScope.subjectKind}\"`,\n });\n }\n\n const replacesRelease: GovernedDocumentReleaseIdentity | undefined = composition.supersedes?.previousRelease;\n if (replacesRelease !== undefined && replacesRelease.document.documentRef !== identity.document.documentRef) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.REPLACES_DIFFERENT_DOCUMENT,\n message: `a release may only supersede the same document: replacing \"${replacesRelease.document.documentRef}\" with \"${identity.document.documentRef}\"`,\n });\n }\n\n const approvalState = composition.approvalDecisions.length > 0\n ? GovernedDocumentReleaseApprovalState.APPROVED\n : GovernedDocumentReleaseApprovalState.UNAPPROVED;\n if (approvalState === GovernedDocumentReleaseApprovalState.UNAPPROVED) {\n advisories.push({\n kind: GovernedDocumentReleaseAdvisoryKind.NOT_APPROVED,\n message: `no approval decision is retained for \"${identity.document.documentRef}\"; the release is composed and marked UNAPPROVED`,\n });\n }\n\n // ONLY incoherence stops here. Everything above that is workflow travels with the release.\n if (issues.length > 0) return { release: undefined, issues, advisories };\n\n const parsed = GovernedDocumentReleaseSchema.safeParse({\n schemaVersion: 1,\n identity,\n definition: definition.identity,\n governanceScope: composition.governanceScope,\n // DERIVED, every one of them — see this module's header.\n documentClass: definition.documentClass,\n audienceKinds: [...definition.audienceKinds],\n publicationChannelKinds: [...definition.publicationChannelKinds],\n allowedInteractionKinds: [...definition.allowedInteractionKinds],\n locale: variant.locale,\n jurisdictionRefs: [...variant.jurisdictionRefs],\n /*\n * The text this release publishes, CAPTURED here (#968). Every later read of the release — the\n * one in force, the one it superseded, the one scheduled next — shows the text it was composed\n * with, not whatever the draft says by then. That only holds if the composed record is what gets\n * committed; recomposing from the live draft on every import re-captures today's text.\n */\n content: draftPublicContent(candidate, variant),\n // The shape of `content` above — not a caller's choice, so not an input.\n contentMediaType: GOVERNED_DOCUMENT_PUBLIC_CONTENT_MEDIA_TYPE,\n issuedAt: composition.issuedAt,\n effectiveAt: composition.effectiveAt,\n ...(composition.expiresAt === undefined ? {} : { expiresAt: composition.expiresAt }),\n approvalDecisions: [...composition.approvalDecisions],\n approvalState,\n // Both, or neither — and both from ONE input, so the schema's pairing rule cannot be violated here.\n ...(composition.supersedes === undefined ? {} : { replacesRelease, materialityDecision: composition.supersedes }),\n });\n if (!parsed.success) {\n return {\n release: undefined,\n issues: [{\n kind: GovernedDocumentReleaseCompositionIssueKind.RELEASE_RECORD_INVALID,\n message: parsed.error.issues.map((issue) => `${issue.path.join(\".\") || \"<root>\"}: ${issue.message}`).join(\"; \"),\n }],\n advisories,\n };\n }\n return { release: parsed.data, issues: [], advisories };\n}\n\n/** What a reader knows: which document, in which language, for which jurisdictions, at which instant. */\nexport interface GovernedDocumentReleaseQuery {\n readonly documentRef: string;\n readonly locale: string;\n readonly jurisdictionRefs: readonly string[];\n /** ISO-8601. The instant the answer is wanted FOR — usually now, but a past instant is what an audit asks. */\n readonly at: string;\n /**\n * ⚠️ THE GATE POINT, and it is OFF by default. Deliberately.\n *\n * Serving an UNAPPROVED release to a real reader is a legally-binding statement leaving the\n * system, which `one-source-of-truth.md` D5 names as a critical gate point — and says such points\n * stay MARKED in every mechanism, notifying and proceeding under the current autonomy posture,\n * with ARMING them part of Gate 3's membership test (\"an application may face a real user\").\n *\n * So this defaults to `false`: an application under construction reads its own documents, and a\n * compliance workflow may not stand in front of the mechanism that builds it. Every returned\n * release carries `approvalState`, so a caller always knows what it has.\n *\n * A surface that genuinely faces a real user passes `true`. When Gate 3 is armed, what changes is\n * that passing it stops being the caller's choice — not that this parameter appears.\n */\n readonly requireApproved?: boolean;\n}\n\n/**\n * THE READ — which release is in force for one document, variant and instant.\n *\n * This is the half `0924c256` asked for when it deleted the custody machine: serving rebuilt as a\n * read over committed files. It takes the releases an application has committed and answers from\n * them alone; there is no store to consult and nothing to retrieve.\n *\n * What decides:\n *\n * - the variant must match EXACTLY. Locale and jurisdictions are one inseparable pair, and nothing\n * here recombines them — an `en-GB` release for `jurisdiction:gb` is not an answer for\n * `jurisdiction:eu`, even though both are `en-GB`;\n * - `effectiveAt` must not be in the future and `expiresAt`, when present, must not have passed.\n * A release that has been ISSUED is not yet in force; the difference is the whole point of\n * carrying both dates;\n * - of those in force, the one that took effect LAST wins, and `releaseVersion` breaks a tie. Two\n * releases sharing an instant is an authoring fault rather than a question, and answering\n * deterministically is better than answering arbitrarily.\n *\n * It does NOT filter by approval unless asked to — see `requireApproved`, which is the marked gate\n * point and is off by default. An application being built must be able to read what it has.\n *\n * Returns `undefined` when nothing is in force, and a caller must treat that as \"this application\n * publishes no such document here yet\" rather than as an error — for most of an application's life\n * that is the true answer, and it is the state every consumer meets first.\n */\nexport function resolveEffectiveDocumentRelease(\n releases: readonly GovernedDocumentRelease[],\n query: GovernedDocumentReleaseQuery,\n): GovernedDocumentRelease | undefined {\n const at = Date.parse(query.at);\n if (Number.isNaN(at)) return undefined;\n const inForce = releases.filter((release) =>\n (query.requireApproved !== true || release.approvalState === GovernedDocumentReleaseApprovalState.APPROVED)\n && release.identity.document.documentRef === query.documentRef\n && release.locale === query.locale\n && sameSet(release.jurisdictionRefs, query.jurisdictionRefs)\n /*\n * The interval question is ONE implementation, in `saas-models`, shared with the record side\n * (`composeGovernedDocumentInteraction`). It was written out here and again there, and two\n * copies of a half-open interval is precisely where a `<=`/`<` slip lives — which would mean a\n * surface offering a release that the recorder then refuses as out of force, or worse, the\n * reverse.\n */\n && governedDocumentReleaseIsInForce(release, query.at));\n return latestGovernedDocumentRelease(inForce);\n}\n\n/**\n * Of several releases, the one that takes effect LAST, with `releaseVersion` breaking a tie — the\n * precedence {@link resolveEffectiveDocumentRelease} applies among the releases in force, named once so\n * every other reader that must pick \"the\" release of a document picks it the same way. `undefined` for\n * an empty list.\n */\nexport function latestGovernedDocumentRelease(\n releases: readonly GovernedDocumentRelease[],\n): GovernedDocumentRelease | undefined {\n if (releases.length === 0) return undefined;\n return releases.reduce((winner, candidate) => {\n const byEffective = Date.parse(candidate.effectiveAt) - Date.parse(winner.effectiveAt);\n if (byEffective !== 0) return byEffective > 0 ? candidate : winner;\n return candidate.identity.releaseVersion > winner.identity.releaseVersion ? candidate : winner;\n });\n}\n/** @wildo_source:part:end saas.specifications.governed-document-release.contract */\n"]}
|
|
1
|
+
{"version":3,"file":"governed-document-release.js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AAM,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE;QAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACvF,IAAI,WAAW,KAAK,CAAC;YAAE,OAAO,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;QACnE,OAAO,SAAS,CAAC,QAAQ,CAAC,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACjG,CAAC,CAAC,CAAC;AACL,CAAC;AACD,oFAAoF","sourcesContent":["import {\n GOVERNED_DOCUMENT_PUBLIC_CONTENT_MEDIA_TYPE,\n governedDocumentReleaseIsInForce,\n GovernedDocumentPublicClauseStanding,\n GovernedDocumentPublicContentSchema,\n GovernedDocumentReleaseApprovalState,\n GovernedDocumentReleaseSchema,\n type GovernedDocumentApprovalDecisionIdentity,\n type GovernedDocumentGovernanceSubjectKind,\n type GovernedDocumentMaterialityDecisionIdentity,\n type GovernedDocumentPublicContent,\n type GovernedDocumentRelease,\n type GovernedDocumentReleaseIdentity,\n} from \"@wildo-ai/saas-models\";\n\n/*\n * CROSSING into `application-creation/`, deliberately and in the established direction — two\n * `*.family-aspects.ts` files here already do it, and nothing in `application-creation/` imports\n * back. The release POLICY is the thing that decides whether releasing is permitted at all, so a\n * composer that could not see it would be the hole rather than the fix.\n *\n * Known shape, stated rather than left implicit: `GovernedDocumentReleaseComposition` is exported\n * from the `assurance` subpath and reaches `ApplicationDocumentReleasePolicyLane`, a NOMINAL enum\n * that subpath does not publish (the ROOT and `application-creation` do). `check:package-entrypoints`\n * reports no finding for this file, and in practice a caller cannot HOLD a policy selection without\n * having resolved the `application-creation` surface that owns the family — there is nowhere else to\n * obtain one. If rule 7 ever does report it, the answer is the root-only probe that rule prescribes,\n * not a re-export: a second door onto one room is what `root-barrel-overlap` refuses.\n */\nimport {\n ApplicationDocumentReleasePolicyLane,\n type ApplicationDocumentReleasePolicySelectionV1,\n} from \"../application-creation/application-document-release-policy-specification.application-creation.schemas\";\nimport {\n ComplianceStatementCompleteness,\n type ComplianceDocumentCandidate,\n} from \"../_core/compliance-documents/compliance-document-candidate.schemas\";\nimport type { AssuranceDocumentPublicationVariant } from \"./application-document-publication.schemas\";\nimport { assuranceDocumentPublicationVariantKey } from \"./application-document-publication.schemas\";\nimport type { AssuranceDocumentDefinition } from \"./assurance-document-system.schemas\";\n\n/**\n * Where `wildo config document-releases` writes the runtime releases module, relative to the application root — the\n * module `saas-config.backend.ts` composes into `compliance.governedDocumentReleases` (the registration acceptance\n * control) and `compliance.publicDocuments`. Beside `brand-assets.generated.ts`.\n *\n * Here rather than in the CLI generator because two processes read it: the generator writes it, and the companion's\n * launch list reads whether it exists (#2238). The `SUBJECT_DATA_RECIPIENTS_GENERATED_RELATIVE_PATH` precedent.\n */\nexport const GOVERNED_DOCUMENT_RELEASES_GENERATED_RELATIVE_PATH = \"backend-api/src/governed-document-releases.generated.ts\";\n\n/**\n * The public text a draft becomes — what a release carries, and what a page shows for a document\n * that was never released (wildo-ai/wildo-ai#968).\n *\n * An ALLOW-LIST, like every other public projection in this lane. A candidate clause carries fact\n * refs, source-policy refs, claim-guard refs, blueprint joins and — when it is incomplete — who closes\n * the gap and how (`closedBy`: issue refs, owners). None of that is the reader's. What survives is the\n * structure (sections and clauses, by ref and order), the prose, and the clause's STANDING: a clause\n * the drafter could not establish is marked `NOT_YET_ESTABLISHED` with the drafter's own `needs` text,\n * never passed off as settled and never dropped.\n *\n * The language and jurisdictions come from the PUBLICATION, not the draft: a candidate may leave both\n * open, and the release (or the application's declared variant, for an unreleased draft) is what\n * decides them. The composer refuses a candidate that contradicts its variant before this runs.\n *\n * Returns the unparsed shape so the composer can validate it inside the release record and report a\n * failure as an issue; {@link projectComplianceDocumentCandidatePublicContent} is the validating form.\n */\nfunction draftPublicContent(\n candidate: ComplianceDocumentCandidate,\n publication: { readonly locale: string; readonly jurisdictionRefs: readonly string[] },\n) {\n return {\n schemaVersion: 1 as const,\n title: candidate.title,\n locale: publication.locale,\n jurisdictionRefs: [...publication.jurisdictionRefs],\n sections: candidate.sections.map((section) => ({\n sectionRef: section.sectionRef,\n order: section.order,\n title: section.title,\n clauses: section.clauses.map((clause) =>\n clause.completeness === ComplianceStatementCompleteness.DERIVED\n ? { clauseRef: clause.clauseRef, order: clause.order, bodyMarkdown: clause.bodyMarkdown, standing: GovernedDocumentPublicClauseStanding.ESTABLISHED }\n : {\n clauseRef: clause.clauseRef,\n order: clause.order,\n bodyMarkdown: clause.bodyMarkdown,\n standing: GovernedDocumentPublicClauseStanding.NOT_YET_ESTABLISHED,\n missingInformation: clause.incompleteness?.needs,\n }),\n })),\n };\n}\n\n/** Validating form of the draft-to-public-text projection. Throws when the result is not valid public content. */\nexport function projectComplianceDocumentCandidatePublicContent(\n candidate: ComplianceDocumentCandidate,\n publication: { readonly locale: string; readonly jurisdictionRefs: readonly string[] },\n): GovernedDocumentPublicContent {\n return GovernedDocumentPublicContentSchema.parse(draftPublicContent(candidate, publication));\n}\n\n/**\n * @wildo_source:part:start saas.specifications.governed-document-release.contract facet:layer:specification facet:family:assurance\n *\n * Turning an APPROVED DRAFT into a RELEASE — the step whose absence meant a\n * drafted governed document could never become a published one (issue #245).\n *\n * The lane could draft: an application holds a real\n * `ComplianceDocumentCandidate` with its sections, clauses and prose. What it\n * had no way to do was say *this draft, in this language, for these\n * jurisdictions, is approved and takes effect on this date* — measured\n * 2026-09-02 and re-measured 2026-09-11, `GovernedDocumentReleaseSchema`\n * appeared in exactly two files, its own definition and its unit test, and\n * nothing anywhere constructed one.\n *\n * **This is a composition, not a custody protocol, and the distinction is the\n * whole design.** `0924c256` removed the previous publication lane — \"a sealed\n * machine that had never run\" — and said what should replace it: *\"A governed\n * document is a file; publishing one is a commit. When an application has a\n * document to serve, serving is rebuilt from files — a read, not a custody\n * protocol.\"* So there is no bundle here, no digest, no content-addressed\n * store and no byte-exact retrieval transport. A release is a record an\n * application COMMITS, and {@link resolveEffectiveDocumentRelease} is the read.\n *\n * **Most of a release is DERIVED rather than authored**, which is the other\n * half of the design. The accepted `AssuranceDocumentDefinition` already\n * decides the document's class, who it addresses, which channels may carry it\n * and which interactions it permits — so asking an author to restate them\n * would invite five ways to disagree with the catalog, and the disagreement\n * would be invisible. What is genuinely a human decision is the narrow part:\n * which draft, which variant, which approval, and when it takes effect.\n */\nexport enum GovernedDocumentReleaseCompositionIssueKind {\n /** The candidate drafts a different document from the one being released. */\n CANDIDATE_DOCUMENT_MISMATCH = \"CANDIDATE_DOCUMENT_MISMATCH\",\n /** The requested variant is not one the application declared it publishes in. */\n VARIANT_NOT_PUBLISHED = \"VARIANT_NOT_PUBLISHED\",\n /** The candidate states a locale or jurisdictions that contradict the variant being released. */\n CANDIDATE_VARIANT_CONTRADICTION = \"CANDIDATE_VARIANT_CONTRADICTION\",\n /** The governance subject is not one the document's definition governs. */\n GOVERNANCE_SUBJECT_NOT_PERMITTED = \"GOVERNANCE_SUBJECT_NOT_PERMITTED\",\n /** A release that replaces another must supersede the SAME document. */\n REPLACES_DIFFERENT_DOCUMENT = \"REPLACES_DIFFERENT_DOCUMENT\",\n /** The release policy consulted governs a different document from the one being released. */\n RELEASE_POLICY_FOR_OTHER_REQUIREMENT = \"RELEASE_POLICY_FOR_OTHER_REQUIREMENT\",\n /** The composed record does not satisfy `GovernedDocumentReleaseSchema`. */\n RELEASE_RECORD_INVALID = \"RELEASE_RECORD_INVALID\",\n}\n\nexport interface GovernedDocumentReleaseCompositionIssue {\n readonly kind: GovernedDocumentReleaseCompositionIssueKind;\n readonly message: string;\n}\n\n/**\n * What is TRUE about a composed release that a human must eventually act on — never a reason to\n * refuse composing it.\n *\n * The split from {@link GovernedDocumentReleaseCompositionIssueKind} is the design, not a severity\n * scale. An ISSUE means the record would be FALSE: it names a document the candidate does not draft,\n * or publishes an `en-GB` draft as `fr-FR`. An ADVISORY means the record is TRUE and the workflow is\n * not finished — nobody has approved it yet, or the application's own policy keeps this document in\n * the draft-only lane.\n *\n * Wildo is agent-first, so the second kind may never stop the mechanism. A compliance workflow\n * standing in front of application creation is exactly the shape this framework refuses: the system\n * must WORK first, and\n * restrictions arrive later as judge-style guards rather than ceremony wired into the mechanism.\n */\nexport enum GovernedDocumentReleaseAdvisoryKind {\n /** Composed without an approval decision. The release says so in `approvalState`. */\n NOT_APPROVED = \"NOT_APPROVED\",\n /**\n * The application's accepted policy keeps this document in the DRAFT_ONLY lane.\n *\n * It refused composition until 2026-09-11, and that was the error this whole split corrects: a\n * lane an application chose for its OWN document became a wall in front of its own build. The\n * release is composed, marked UNAPPROVED, and the lane is reported — so the decision to serve it\n * is taken where serving happens, which is Gate 3's to arm.\n */\n POLICY_IS_DRAFT_ONLY = \"POLICY_IS_DRAFT_ONLY\",\n}\n\nexport interface GovernedDocumentReleaseAdvisory {\n readonly kind: GovernedDocumentReleaseAdvisoryKind;\n readonly message: string;\n}\n\n/** What a human actually decides. Everything else on the record is derived from the accepted definition. */\nexport interface GovernedDocumentReleaseComposition {\n /** The framework-accepted definition. Supplies class, audiences, channels and permitted interactions. */\n readonly definition: AssuranceDocumentDefinition;\n /** The approved draft whose content this release publishes. */\n readonly candidate: ComplianceDocumentCandidate;\n /** The exact locale x jurisdiction combination being published. */\n readonly variant: AssuranceDocumentPublicationVariant;\n /** Every variant the application declared it publishes in; the variant above must be one of them. */\n readonly publishedVariants: readonly AssuranceDocumentPublicationVariant[];\n /**\n * The application's accepted release-policy selection for THIS document's requirement.\n *\n * REQUIRED, because releasing is the act that policy exists to govern. `DRAFT_ONLY` means the\n * document \"may be generated and retained, but cannot be released or published\" — a sentence with\n * no effect unless something refuses, and the only place that can refuse is here. An optional\n * input would have made the strictest lane the easiest one to skip: omit the field, get a release.\n *\n * The other two lanes do not branch here. Whether an operator attestation or a qualified review\n * actually happened is recorded in `approvalDecisions`, and the selection's own schema already\n * requires an attested lane to carry its explicit limitations.\n */\n readonly releasePolicy: ApplicationDocumentReleasePolicySelectionV1;\n /** The requirement the policy must govern — the join is by requirement, never by document ref. */\n readonly requirement: { readonly requirementRef: string; readonly requirementVersion: number };\n readonly identity: GovernedDocumentReleaseIdentity;\n readonly governanceScope: GovernedDocumentRelease[\"governanceScope\"];\n /**\n * The approvals retained for this release, if any yet.\n *\n * EMPTY is a first-class answer, not a missing input: it composes an UNAPPROVED release and an\n * advisory saying so. Requiring one here would mean an application could only hold a release by\n * forging an approval identity, which is worse than having none.\n */\n readonly approvalDecisions: readonly GovernedDocumentApprovalDecisionIdentity[];\n readonly issuedAt: string;\n readonly effectiveAt: string;\n readonly expiresAt?: string;\n /**\n * Superseding another release, stated ONCE as the materiality decision.\n *\n * The release record carries both `replacesRelease` and `materialityDecision`, and its schema\n * requires them to be present together AND to name the same previous release. So the caller gives\n * the decision and `replacesRelease` is DERIVED from `previousRelease` — two fields that must\n * agree are not two decisions, and asking for both would only create a way to disagree.\n *\n * The decision itself is the governance question a replacement owes: did the change matter enough\n * that the audience must meet the document again? `requiredInteractionKinds` is where that lands.\n */\n readonly supersedes?: GovernedDocumentMaterialityDecisionIdentity;\n}\nconst sorted = (values: readonly string[]): string[] => [...values].sort();\nconst sameSet = (left: readonly string[], right: readonly string[]): boolean =>\n left.length === right.length && sorted(left).every((value, index) => value === sorted(right)[index]);\n\n/**\n * Compose one release, or report why the parts do not agree.\n *\n * Returns issues rather than throwing, following the `_core` validator convention: a caller\n * assembling several releases wants all the disagreements at once, not the first one.\n */\nexport function composeGovernedDocumentRelease(\n composition: GovernedDocumentReleaseComposition,\n): {\n readonly release: GovernedDocumentRelease | undefined;\n readonly issues: readonly GovernedDocumentReleaseCompositionIssue[];\n readonly advisories: readonly GovernedDocumentReleaseAdvisory[];\n} {\n const issues: GovernedDocumentReleaseCompositionIssue[] = [];\n const advisories: GovernedDocumentReleaseAdvisory[] = [];\n const { candidate, variant, identity, definition } = composition;\n\n if (candidate.documentRef !== identity.document.documentRef) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.CANDIDATE_DOCUMENT_MISMATCH,\n message: `candidate drafts \"${candidate.documentRef}\" but the release identifies \"${identity.document.documentRef}\"`,\n });\n }\n\n if (composition.releasePolicy.requirementRef !== composition.requirement.requirementRef\n || composition.releasePolicy.requirementVersion !== composition.requirement.requirementVersion) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.RELEASE_POLICY_FOR_OTHER_REQUIREMENT,\n message: `release policy governs \"${composition.releasePolicy.requirementRef}@${composition.releasePolicy.requirementVersion}\" `\n + `but this release is for \"${composition.requirement.requirementRef}@${composition.requirement.requirementVersion}\"`,\n });\n }\n if (composition.releasePolicy.lane === ApplicationDocumentReleasePolicyLane.DRAFT_ONLY) {\n advisories.push({\n kind: GovernedDocumentReleaseAdvisoryKind.POLICY_IS_DRAFT_ONLY,\n message: `the accepted release policy puts \"${composition.requirement.requirementRef}\" in the DRAFT_ONLY lane: compose and retain it, but nothing may serve it as published`,\n });\n }\n\n const variantKey = assuranceDocumentPublicationVariantKey(variant);\n if (!composition.publishedVariants.some((published) => assuranceDocumentPublicationVariantKey(published) === variantKey)) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.VARIANT_NOT_PUBLISHED,\n message: `variant \"${variantKey}\" is not among the variants the application declared it publishes in`,\n });\n }\n\n /*\n * A candidate MAY leave locale and jurisdictions open — that is deliberate upstream, so a draft can\n * exist before the routing decision. What it may not do is state them and DISAGREE: releasing an\n * `en-GB` draft as the `fr-FR` variant would publish text under a claim it does not make.\n */\n if (candidate.locale !== undefined && candidate.locale !== variant.locale) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.CANDIDATE_VARIANT_CONTRADICTION,\n message: `candidate states locale \"${candidate.locale}\" but the release publishes \"${variant.locale}\"`,\n });\n }\n if (candidate.jurisdictionRefs !== undefined && !sameSet(candidate.jurisdictionRefs, variant.jurisdictionRefs)) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.CANDIDATE_VARIANT_CONTRADICTION,\n message: `candidate states jurisdictions [${sorted(candidate.jurisdictionRefs).join(\", \")}] but the release publishes [${sorted(variant.jurisdictionRefs).join(\", \")}]`,\n });\n }\n\n if (!definition.governanceSubjectKinds.includes(composition.governanceScope.subjectKind as GovernedDocumentGovernanceSubjectKind)) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.GOVERNANCE_SUBJECT_NOT_PERMITTED,\n message: `definition \"${definition.identity.definitionRef}\" governs [${definition.governanceSubjectKinds.join(\", \")}], not \"${composition.governanceScope.subjectKind}\"`,\n });\n }\n\n const replacesRelease: GovernedDocumentReleaseIdentity | undefined = composition.supersedes?.previousRelease;\n if (replacesRelease !== undefined && replacesRelease.document.documentRef !== identity.document.documentRef) {\n issues.push({\n kind: GovernedDocumentReleaseCompositionIssueKind.REPLACES_DIFFERENT_DOCUMENT,\n message: `a release may only supersede the same document: replacing \"${replacesRelease.document.documentRef}\" with \"${identity.document.documentRef}\"`,\n });\n }\n\n const approvalState = composition.approvalDecisions.length > 0\n ? GovernedDocumentReleaseApprovalState.APPROVED\n : GovernedDocumentReleaseApprovalState.UNAPPROVED;\n if (approvalState === GovernedDocumentReleaseApprovalState.UNAPPROVED) {\n advisories.push({\n kind: GovernedDocumentReleaseAdvisoryKind.NOT_APPROVED,\n message: `no approval decision is retained for \"${identity.document.documentRef}\"; the release is composed and marked UNAPPROVED`,\n });\n }\n\n // ONLY incoherence stops here. Everything above that is workflow travels with the release.\n if (issues.length > 0) return { release: undefined, issues, advisories };\n\n const parsed = GovernedDocumentReleaseSchema.safeParse({\n schemaVersion: 1,\n identity,\n definition: definition.identity,\n governanceScope: composition.governanceScope,\n // DERIVED, every one of them — see this module's header.\n documentClass: definition.documentClass,\n audienceKinds: [...definition.audienceKinds],\n publicationChannelKinds: [...definition.publicationChannelKinds],\n allowedInteractionKinds: [...definition.allowedInteractionKinds],\n locale: variant.locale,\n jurisdictionRefs: [...variant.jurisdictionRefs],\n /*\n * The text this release publishes, CAPTURED here (#968). Every later read of the release — the\n * one in force, the one it superseded, the one scheduled next — shows the text it was composed\n * with, not whatever the draft says by then. That only holds if the composed record is what gets\n * committed; recomposing from the live draft on every import re-captures today's text.\n */\n content: draftPublicContent(candidate, variant),\n // The shape of `content` above — not a caller's choice, so not an input.\n contentMediaType: GOVERNED_DOCUMENT_PUBLIC_CONTENT_MEDIA_TYPE,\n issuedAt: composition.issuedAt,\n effectiveAt: composition.effectiveAt,\n ...(composition.expiresAt === undefined ? {} : { expiresAt: composition.expiresAt }),\n approvalDecisions: [...composition.approvalDecisions],\n approvalState,\n // Both, or neither — and both from ONE input, so the schema's pairing rule cannot be violated here.\n ...(composition.supersedes === undefined ? {} : { replacesRelease, materialityDecision: composition.supersedes }),\n });\n if (!parsed.success) {\n return {\n release: undefined,\n issues: [{\n kind: GovernedDocumentReleaseCompositionIssueKind.RELEASE_RECORD_INVALID,\n message: parsed.error.issues.map((issue) => `${issue.path.join(\".\") || \"<root>\"}: ${issue.message}`).join(\"; \"),\n }],\n advisories,\n };\n }\n return { release: parsed.data, issues: [], advisories };\n}\n\n/** What a reader knows: which document, in which language, for which jurisdictions, at which instant. */\nexport interface GovernedDocumentReleaseQuery {\n readonly documentRef: string;\n readonly locale: string;\n readonly jurisdictionRefs: readonly string[];\n /** ISO-8601. The instant the answer is wanted FOR — usually now, but a past instant is what an audit asks. */\n readonly at: string;\n /**\n * ⚠️ THE GATE POINT, and it is OFF by default. Deliberately.\n *\n * Serving an UNAPPROVED release to a real reader is a legally-binding statement leaving the\n * system, which `one-source-of-truth.md` D5 names as a critical gate point — and says such points\n * stay MARKED in every mechanism, notifying and proceeding under the current autonomy posture,\n * with ARMING them part of Gate 3's membership test (\"an application may face a real user\").\n *\n * So this defaults to `false`: an application under construction reads its own documents, and a\n * compliance workflow may not stand in front of the mechanism that builds it. Every returned\n * release carries `approvalState`, so a caller always knows what it has.\n *\n * A surface that genuinely faces a real user passes `true`. When Gate 3 is armed, what changes is\n * that passing it stops being the caller's choice — not that this parameter appears.\n */\n readonly requireApproved?: boolean;\n}\n\n/**\n * THE READ — which release is in force for one document, variant and instant.\n *\n * This is the half `0924c256` asked for when it deleted the custody machine: serving rebuilt as a\n * read over committed files. It takes the releases an application has committed and answers from\n * them alone; there is no store to consult and nothing to retrieve.\n *\n * What decides:\n *\n * - the variant must match EXACTLY. Locale and jurisdictions are one inseparable pair, and nothing\n * here recombines them — an `en-GB` release for `jurisdiction:gb` is not an answer for\n * `jurisdiction:eu`, even though both are `en-GB`;\n * - `effectiveAt` must not be in the future and `expiresAt`, when present, must not have passed.\n * A release that has been ISSUED is not yet in force; the difference is the whole point of\n * carrying both dates;\n * - of those in force, the one that took effect LAST wins, and `releaseVersion` breaks a tie. Two\n * releases sharing an instant is an authoring fault rather than a question, and answering\n * deterministically is better than answering arbitrarily.\n *\n * It does NOT filter by approval unless asked to — see `requireApproved`, which is the marked gate\n * point and is off by default. An application being built must be able to read what it has.\n *\n * Returns `undefined` when nothing is in force, and a caller must treat that as \"this application\n * publishes no such document here yet\" rather than as an error — for most of an application's life\n * that is the true answer, and it is the state every consumer meets first.\n */\nexport function resolveEffectiveDocumentRelease(\n releases: readonly GovernedDocumentRelease[],\n query: GovernedDocumentReleaseQuery,\n): GovernedDocumentRelease | undefined {\n const at = Date.parse(query.at);\n if (Number.isNaN(at)) return undefined;\n const inForce = releases.filter((release) =>\n (query.requireApproved !== true || release.approvalState === GovernedDocumentReleaseApprovalState.APPROVED)\n && release.identity.document.documentRef === query.documentRef\n && release.locale === query.locale\n && sameSet(release.jurisdictionRefs, query.jurisdictionRefs)\n /*\n * The interval question is ONE implementation, in `saas-models`, shared with the record side\n * (`composeGovernedDocumentInteraction`). It was written out here and again there, and two\n * copies of a half-open interval is precisely where a `<=`/`<` slip lives — which would mean a\n * surface offering a release that the recorder then refuses as out of force, or worse, the\n * reverse.\n */\n && governedDocumentReleaseIsInForce(release, query.at));\n return latestGovernedDocumentRelease(inForce);\n}\n\n/**\n * Of several releases, the one that takes effect LAST, with `releaseVersion` breaking a tie — the\n * precedence {@link resolveEffectiveDocumentRelease} applies among the releases in force, named once so\n * every other reader that must pick \"the\" release of a document picks it the same way. `undefined` for\n * an empty list.\n */\nexport function latestGovernedDocumentRelease(\n releases: readonly GovernedDocumentRelease[],\n): GovernedDocumentRelease | undefined {\n if (releases.length === 0) return undefined;\n return releases.reduce((winner, candidate) => {\n const byEffective = Date.parse(candidate.effectiveAt) - Date.parse(winner.effectiveAt);\n if (byEffective !== 0) return byEffective > 0 ? candidate : winner;\n return candidate.identity.releaseVersion > winner.identity.releaseVersion ? candidate : winner;\n });\n}\n/** @wildo_source:part:end saas.specifications.governed-document-release.contract */\n"]}
|
|
@@ -37,6 +37,7 @@ import type { ApplicationDocumentationPlan } from './technical-documentation/app
|
|
|
37
37
|
import type { ApplicationDocumentationChapterSet } from './technical-documentation/application-documentation-chapters.schemas';
|
|
38
38
|
import type { IntegrationPlan } from './_core/integration-plan/integration-plan.schemas';
|
|
39
39
|
import type { ApplicationMaturity } from './_core/application-maturity/application-maturity.schemas';
|
|
40
|
+
import type { BrandNameScreening } from './_core/brand/brand-name-screening.schemas';
|
|
40
41
|
import type { ApplicationDocumentReleasePolicySpecification } from './application-creation/application-document-release-policy-specification.application-creation.schemas';
|
|
41
42
|
import type { ApplicationDocumentReleaseSet } from './assurance/application-document-release-set.schemas';
|
|
42
43
|
import type { GovernedDocumentReleaseComposition } from './assurance/governed-document-release';
|
|
@@ -47,7 +48,7 @@ export * from './technical-documentation/engine-documentation-specification-cata
|
|
|
47
48
|
*
|
|
48
49
|
* Typed companion export surface: registries of resource specs, definitions, and view specs the dev companion materializes.
|
|
49
50
|
*/
|
|
50
|
-
export interface SpecificationsCompanionExports<TResourceSpecifications = ResourceSpecification, TBusinessSemanticsSnapshot = BusinessSemanticsSnapshotDeclaration, TFeatureSpecifications = FeatureSpecification, TMilestoneSpecifications = MilestoneSpecification, TProductSpecifications = ProductSpecification, TRoleSpecifications = RoleSpecification, TFrontendComponentSpecifications = FrontendComponentSpecification, TCompositeViewSpecifications = CompositeViewSpecification, TFullCustomViewSpecifications = FullCustomViewSpecification, TFlowsActorsViewSpecifications = FlowsActorsViewSpecification, TChartViewSpecifications = ChartViewSpecification, TExecutionViewSpecifications = ExecutionViewSpecification, TSystemEmailTemplateSpecifications = SystemEmailTemplateSpecification, TOnboardingViewSpecifications = OnboardingViewSpecification, TGuidanceFlowSpecifications = GuidanceFlowSpecification, TDataSeedSpecifications = DataSeedSpecification, TMarketSnapshot = MarketSnapshot, TCatalogSpecifications = CatalogSpecifications, TSidebarSectionSpecifications = SidebarSectionSpecification, TAssertionSpecifications = AssertionSpecificationSnapshot, TVisionSnapshot = VisionSnapshot, TRequirementsSnapshot = RequirementsSnapshot, TRoadmapSnapshot = RoadmapSnapshot, TBuildPlanTaskGraph = BuildPlanTaskGraph, TPlacementPlan = PlacementPlan, TDomainPlanOutputSet = DomainPlanOutputSet, TBusinessModelLiteSnapshot = BusinessModelLiteSnapshot, TBrandSnapshot = BrandSnapshot, TExpertPersonaCharters = ExpertPersonaCharter[], TFeatureSpecificationDrafts = FeatureSpecificationDrafts, TComplianceSpecification = AssuranceProgramSpecification, TDocumentPublicationSpecification = ApplicationDocumentPublicationSpecification, TDocumentFactSpecification = ApplicationDocumentFactSpecification, TDocumentReleasePolicySpecification = ApplicationDocumentReleasePolicySpecification, TDocumentReleaseSet = ApplicationDocumentReleaseSet, TProcessorRegister = ApplicationProcessorRegister, TAuthoredDocumentFactSpecification = ApplicationAuthoredDocumentFactSpecification, TDocumentReleaseCompositions = readonly GovernedDocumentReleaseComposition[], TRiskRegister = ApplicationRiskRegister, TCreatorInputs = ApplicationCreatorInputs, TCapabilityComposition = CapabilityComposition, TWebsitePlan = WebsitePlan, TExperiencePlan = ExperiencePlan, TApplicationDocumentationPlan = ApplicationDocumentationPlan, TIntegrationPlan = IntegrationPlan, TApplicationMaturity = ApplicationMaturity> {
|
|
51
|
+
export interface SpecificationsCompanionExports<TResourceSpecifications = ResourceSpecification, TBusinessSemanticsSnapshot = BusinessSemanticsSnapshotDeclaration, TFeatureSpecifications = FeatureSpecification, TMilestoneSpecifications = MilestoneSpecification, TProductSpecifications = ProductSpecification, TRoleSpecifications = RoleSpecification, TFrontendComponentSpecifications = FrontendComponentSpecification, TCompositeViewSpecifications = CompositeViewSpecification, TFullCustomViewSpecifications = FullCustomViewSpecification, TFlowsActorsViewSpecifications = FlowsActorsViewSpecification, TChartViewSpecifications = ChartViewSpecification, TExecutionViewSpecifications = ExecutionViewSpecification, TSystemEmailTemplateSpecifications = SystemEmailTemplateSpecification, TOnboardingViewSpecifications = OnboardingViewSpecification, TGuidanceFlowSpecifications = GuidanceFlowSpecification, TDataSeedSpecifications = DataSeedSpecification, TMarketSnapshot = MarketSnapshot, TCatalogSpecifications = CatalogSpecifications, TSidebarSectionSpecifications = SidebarSectionSpecification, TAssertionSpecifications = AssertionSpecificationSnapshot, TVisionSnapshot = VisionSnapshot, TRequirementsSnapshot = RequirementsSnapshot, TRoadmapSnapshot = RoadmapSnapshot, TBuildPlanTaskGraph = BuildPlanTaskGraph, TPlacementPlan = PlacementPlan, TDomainPlanOutputSet = DomainPlanOutputSet, TBusinessModelLiteSnapshot = BusinessModelLiteSnapshot, TBrandSnapshot = BrandSnapshot, TExpertPersonaCharters = ExpertPersonaCharter[], TFeatureSpecificationDrafts = FeatureSpecificationDrafts, TComplianceSpecification = AssuranceProgramSpecification, TDocumentPublicationSpecification = ApplicationDocumentPublicationSpecification, TDocumentFactSpecification = ApplicationDocumentFactSpecification, TDocumentReleasePolicySpecification = ApplicationDocumentReleasePolicySpecification, TDocumentReleaseSet = ApplicationDocumentReleaseSet, TProcessorRegister = ApplicationProcessorRegister, TAuthoredDocumentFactSpecification = ApplicationAuthoredDocumentFactSpecification, TDocumentReleaseCompositions = readonly GovernedDocumentReleaseComposition[], TRiskRegister = ApplicationRiskRegister, TCreatorInputs = ApplicationCreatorInputs, TCapabilityComposition = CapabilityComposition, TWebsitePlan = WebsitePlan, TExperiencePlan = ExperiencePlan, TApplicationDocumentationPlan = ApplicationDocumentationPlan, TIntegrationPlan = IntegrationPlan, TApplicationMaturity = ApplicationMaturity, TBrandNameScreening = BrandNameScreening> {
|
|
51
52
|
resourceSpecifications: TResourceSpecifications;
|
|
52
53
|
applicationBusinessSemanticsSnapshot?: TBusinessSemanticsSnapshot;
|
|
53
54
|
/**
|
|
@@ -570,6 +571,14 @@ export interface SpecificationsCompanionExports<TResourceSpecifications = Resour
|
|
|
570
571
|
* never a gate. Read by the coherence report and the workbench.
|
|
571
572
|
*/
|
|
572
573
|
applicationMaturity?: TApplicationMaturity;
|
|
574
|
+
/**
|
|
575
|
+
* WHICH NAMES were proposed for the brand and what a minimal trademark screening of each found —
|
|
576
|
+
* registers, classes and jurisdictions searched, per-register results with sources and dates, and the
|
|
577
|
+
* competitor collisions beside them. Produced by `top_down.brand-naming`; the brand-identity interview's
|
|
578
|
+
* `brand-name` CHOICE is computed from it, and the coherence report reads it to say where the chosen
|
|
579
|
+
* brand name stands. A screening, never a legal clearance opinion.
|
|
580
|
+
*/
|
|
581
|
+
brandNameScreening?: TBrandNameScreening;
|
|
573
582
|
}
|
|
574
583
|
/**
|
|
575
584
|
* Aggregate of every catalog vocabulary an app can wire on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-exports.d.ts","sourceRoot":"","sources":["../../../src/companion-exports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACzG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,KAAK,EAAE,m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