@wildo-ai/saas-specifications 1.1.13 → 1.1.14
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/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +28 -5
- package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js +4 -1
- package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +4 -0
- package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js +10 -0
- package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +2 -1
- package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.js +6 -2
- package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.js.map +1 -1
- package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.js +6 -5
- package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +2 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.d.ts +9 -0
- package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.js +136 -0
- package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.js.map +1 -0
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +4 -2
- package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +6 -5
- package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.js +2 -1
- package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +10 -7
- package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts +1 -0
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +7 -7
- package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
- package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts +2 -2
- package/dist/esm/engine/users/resources/users.resource.specification.js +1 -1
- package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor-register.schemas.js","sourceRoot":"","sources":["../../../../src/_core/compliance-documents/processor-register.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,K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AC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;QAC1J,6BAA6B,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;KACnH,CAAC;AACJ,CAAC","sourcesContent":["import { z } from \"zod\";\n// Side-effect import: this module calls `.systemEnum()` at load, so the decorators must be installed first —\n// never by the importer's luck (#966). A named import used only as a type would be elided and install nothing.\nimport '@wildo-ai/zod-decorators';\nimport {\n establishedProviderComplianceProfile,\n oldestProviderComplianceEvidenceDate,\n type ProviderComplianceProfile,\n} from '@wildo-ai/saas-models';\n\n/** @wildo_source:part:start saas.specifications.processor-register facet:layer:shared facet:audience:app-developer */\n/**\n * **Who else processes personal data, under what legal identity, and where.**\n *\n * ## The gap this closes\n *\n * A configured provider establishes THAT a third party is involved and WHAT FUNCTION it performs —\n * `EngineCapability` gives email delivery, storage, payments, LLM inference, observability. It gives\n * none of the three things a reader of a privacy notice needs: the processor's legal identity, the\n * region it processes in, and its own subprocessors (issue #88).\n *\n * That gap blocks two concerns rather than one, and the second cannot be answered independently: an\n * international-transfer statement is a statement about WHERE a recipient processes, so a provider\n * carrying no region cannot support one.\n *\n * ## Declared by the APPLICATION, not derived from the provider\n *\n * A provider's legal entity is a fact about a vendor, and it is tempting to put it on the provider\n * definition so every application inherits it. It is not carried there, deliberately: what a document\n * must state is the arrangement THIS operator has — which vendor, in which region, under which\n * contract — and two applications using the same vendor can honestly differ on all three. A\n * framework-supplied identity would also be a fact the framework cannot keep true: vendors reorganise,\n * and a stale legal entity in a published notice is worse than an absent one.\n *\n * So the register is authored beside the application's other specifications and read from there. What\n * the framework contributes is the QUESTION and the gap report, never the answer.\n *\n * ## Researched vendor facts are SUGGESTIONS, adopted only by the operator's commit (decided 2026-09-25, #1744)\n *\n * The framework does research the vendors applications actually declare — legal entity, processing regions,\n * sub-processor list, data processing agreement — and ships each fact on the provider's compliance profile with the\n * page it was read from and the date (`evidence`, #1708). Those facts are SUGGESTIONS: the brief offers them beside an\n * undeclared entry as the question to answer, and nothing reaches a document until the operator checks the page,\n * copies the fact into THIS register and commits it. The commit is the adoption (`one-source-of-truth.md` rule 2);\n * the framework's statement stays \"this is what we read, on this date, at this URL\". Rejected: publishing the facts\n * straight into computed document facts, which would make the framework the author of a legal statement in someone\n * else's notice, and could not be walked back once a notice carried it; and shipping no facts at all, which leaves\n * every operator to research every vendor alone. A stale suggestion is caught by `complianceFactStaleness`.\n *\n * ## Absence is a gap with a NAME, because the configured set is already known\n *\n * The application's composition already lists its configured providers. Comparing that list against\n * this register turns \"processor identities are not established\" into \"`anthropic` is configured and\n * undeclared\" — a gap an operator can act on, per provider, rather than a sentence they cannot.\n *\n * See {@link undeclaredProcessorRefs}. An entry ABSENT from the register means nobody has established\n * that processor's identity; it never means the provider is not in use.\n */\n\n/**\n * One subprocessor a declared processor uses in turn.\n *\n * Carried because a privacy notice's recipient statement is only as true as its deepest hop: a\n * customer's data reaching a vendor's own hosting provider is a disclosure, and a notice naming only\n * the first hop understates who holds the data.\n */\nexport const ProcessorSubprocessorSchema = z.strictObject({\n /** The subprocessor's name as the processor discloses it. */\n name: z.string().trim().min(1),\n /**\n * Where this subprocessor processes, as the processor discloses it.\n *\n * Required: a subprocessor with no location cannot support the transfer statement that is the whole\n * reason for following the chain this far.\n */\n processingRegions: z.array(z.string().trim().min(1)).min(1),\n});\nexport type ProcessorSubprocessor = z.infer<typeof ProcessorSubprocessorSchema>;\n\n/**\n * WHICH KIND of subprocessor an entry describes.\n *\n * **Providers are a SUBSET of subprocessors, and this register was built as if they were the whole\n * set.** Every entry keyed on `providerRef` and the schema enforced one entry per provider, which\n * made it structurally unable to hold a subprocessor the application does not configure as a\n * provider — a hosting company, a CDN, a support tool, an accountant. Those are processors under\n * Art. 28 and belong in the same register a notice reads (issue #130).\n *\n * The discriminator exists because the two arms differ in what can be CHECKED, not merely in shape.\n * A configured-provider entry joins to the application's composition, so a claim about a provider it\n * does not configure is detectable and a configured provider with no entry is a reportable gap. An\n * authored entry joins to nothing: no configuration mentions the operator's hosting company, so the\n * framework can neither confirm it nor notice its absence. Collapsing them would present an\n * unverifiable claim with the same authority as a checkable one.\n */\nexport enum ProcessorRegisterEntryKind {\n /**\n * A provider the application configures, or the vendor of a vendor-hosted system-of-record instance (keyed by the\n * instance name, #2585). Joins to `providerRef`, and its absence is reportable.\n */\n CONFIGURED_PROVIDER = \"CONFIGURED_PROVIDER\",\n /** A subprocessor nothing in the configuration mentions. Unverifiable by construction, and stated as authored. */\n AUTHORED = \"AUTHORED\",\n}\n\n/**\n * The instrument that makes a transfer of personal data out of its origin jurisdiction lawful.\n *\n * spec-cite: GDPR Chapter V — Art. 45 (adequacy), Art. 46(2)(b)–(f) (appropriate safeguards), Art. 47 (binding\n * corporate rules), Art. 49(1) (derogations). The UK GDPR keeps the same structure, so one vocabulary serves\n * both; the INSTRUMENT that fills a member differs by jurisdiction (the EU clauses, the UK Addendum), which is\n * why each safeguard names its instrument in prose beside the member.\n *\n * Recorded, never computed (#126): which mechanism applies is a legal determination with a shelf life —\n * an adequacy decision can be struck down while the vendor stays where it is — so the framework offers the\n * place to write it down and derives nothing from a region.\n */\nexport enum InternationalTransferMechanism {\n /** Art. 45 — the destination is covered by an adequacy decision (for the United States, the Data Privacy Framework, for a certified recipient). */\n ADEQUACY_DECISION = \"ADEQUACY_DECISION\",\n /** Art. 46(2)(c)/(d) — standard data protection clauses, or a jurisdiction's equivalent (the UK Addendum to them). */\n STANDARD_CONTRACTUAL_CLAUSES = \"STANDARD_CONTRACTUAL_CLAUSES\",\n /** Art. 46(2)(b) and Art. 47 — binding corporate rules approved for the recipient's group. */\n BINDING_CORPORATE_RULES = \"BINDING_CORPORATE_RULES\",\n /** Art. 46(2)(e) — an approved code of conduct with binding commitments of the recipient. */\n APPROVED_CODE_OF_CONDUCT = \"APPROVED_CODE_OF_CONDUCT\",\n /** Art. 46(2)(f) — an approved certification with binding commitments of the recipient. */\n APPROVED_CERTIFICATION = \"APPROVED_CERTIFICATION\",\n /** Art. 49 — a derogation for a specific situation. Requires {@link InternationalTransferDerogation}. */\n DEROGATION = \"DEROGATION\",\n}\n\n/** Which Art. 49 derogation a {@link InternationalTransferMechanism.DEROGATION} relies on. spec-cite: GDPR Art. 49(1). */\nexport enum InternationalTransferDerogation {\n /** Art. 49(1)(a) — explicit consent after being informed of the risks. */\n EXPLICIT_CONSENT = \"EXPLICIT_CONSENT\",\n /** Art. 49(1)(b) — necessary for a contract with the data subject. */\n CONTRACT_WITH_SUBJECT = \"CONTRACT_WITH_SUBJECT\",\n /** Art. 49(1)(c) — necessary for a contract concluded in the subject's interest with another party. */\n CONTRACT_IN_SUBJECT_INTEREST = \"CONTRACT_IN_SUBJECT_INTEREST\",\n /** Art. 49(1)(d) — important reasons of public interest. */\n PUBLIC_INTEREST = \"PUBLIC_INTEREST\",\n /** Art. 49(1)(e) — establishment, exercise or defence of legal claims. */\n LEGAL_CLAIMS = \"LEGAL_CLAIMS\",\n /** Art. 49(1)(f) — vital interests where the subject cannot consent. */\n VITAL_INTERESTS = \"VITAL_INTERESTS\",\n /** Art. 49(1)(g) — a transfer from a public register. */\n PUBLIC_REGISTER = \"PUBLIC_REGISTER\",\n /** Art. 49(1), second subparagraph — compelling legitimate interests, for a non-repetitive transfer. */\n COMPELLING_LEGITIMATE_INTERESTS = \"COMPELLING_LEGITIMATE_INTERESTS\",\n}\n\n/**\n * Whether reaching this processor moves personal data out of the jurisdiction it came from.\n *\n * A DETERMINATION, recorded by the operator, because regions are free text: nothing can compare\n * `United States` or `eu-west-1` with a declared operating jurisdiction, so the framework cannot tell a\n * domestic processor from a foreign one and does not guess.\n */\nexport enum ProcessorTransferDeterminationKind {\n /** Every region this processor (and its subprocessors) uses lies within the jurisdictions the data comes from. */\n NO_TRANSFER = \"NO_TRANSFER\",\n /** Personal data leaves its origin jurisdiction to reach this processor, under the safeguards named. */\n TRANSFER = \"TRANSFER\",\n}\n\n/** The safeguard one origin jurisdiction's data travels under. */\nexport const ProcessorTransferSafeguardSchema = z\n .strictObject({\n /** The jurisdiction the data leaves — one of the application's `operatingJurisdictions`. */\n originJurisdictionSlug: z.string().trim().min(1),\n mechanism: z.enum(InternationalTransferMechanism).systemEnum(\"InternationalTransferMechanism\"),\n /** Required with {@link InternationalTransferMechanism.DEROGATION}, refused otherwise. */\n derogation: z.enum(InternationalTransferDerogation).systemEnum(\"InternationalTransferDerogation\").optional(),\n /**\n * The instrument, as a reader could look it up: \"EU SCCs (Commission Decision 2021/914), Module Two\",\n * \"UK Addendum to the EU SCCs\", \"EU-US Data Privacy Framework — recipient certified\". A mechanism\n * member alone tells a reader the article, not the document that binds the recipient.\n */\n instrument: z.string().trim().min(1),\n })\n .superRefine((safeguard, context) => {\n const isDerogation = safeguard.mechanism === InternationalTransferMechanism.DEROGATION;\n if (isDerogation !== (safeguard.derogation !== undefined)) {\n context.addIssue({\n code: \"custom\",\n path: [\"derogation\"],\n message: isDerogation ? \"a derogation must name which Art. 49 ground it relies on\" : \"only a DEROGATION mechanism names a derogation\",\n });\n }\n });\nexport type ProcessorTransferSafeguard = z.infer<typeof ProcessorTransferSafeguardSchema>;\n\n/**\n * The operator's transfer determination for one register entry.\n *\n * Carried by the ENTRY, not the provider, and not per subprocessor: a vendor's regions change when it opens\n * a data centre, a mechanism changes when a court rules, and the processor's own contract is what binds its\n * onward transfers to its subprocessors — so the determination for reaching this processor covers the chain\n * behind it. It is OPTIONAL, and absence means \"not determined\": the `international-transfers` fact then\n * answers nothing, because a register with an undetermined entry cannot support either \"no transfer\" or a\n * list of safeguards.\n */\nexport const ProcessorTransferDeterminationSchema = z.discriminatedUnion(\"kind\", [\n z.strictObject({\n kind: z.literal(ProcessorTransferDeterminationKind.NO_TRANSFER).systemEnum(\"ProcessorTransferDeterminationKind\"),\n /** Why none of the regions is outside the origin jurisdictions — the comparison the framework cannot make. */\n rationale: z.string().trim().min(1),\n }),\n z\n .strictObject({\n kind: z.literal(ProcessorTransferDeterminationKind.TRANSFER).systemEnum(\"ProcessorTransferDeterminationKind\"),\n /** One safeguard per origin jurisdiction whose data reaches this processor. */\n safeguards: z.array(ProcessorTransferSafeguardSchema).min(1),\n })\n .superRefine((determination, context) => {\n const origins = determination.safeguards.map((safeguard) => safeguard.originJurisdictionSlug);\n if (new Set(origins).size !== origins.length) {\n context.addIssue({ code: \"custom\", path: [\"safeguards\"], message: \"one safeguard per origin jurisdiction\" });\n }\n }),\n]);\nexport type ProcessorTransferDetermination = z.infer<typeof ProcessorTransferDeterminationSchema>;\n\n/**\n * Whether THIS operator has a data processing agreement with the processor — the operator's fact, never the vendor's\n * (#1709). A vendor OFFERING a DPA is a suggestion its compliance profile may carry (`dataProcessingAgreementUrl`);\n * whether this operator is bound by one is not something the framework can know.\n *\n * spec-cite: GDPR Art. 28(3), https://gdpr-info.eu/art-28-gdpr/ — \"Processing by a processor shall be governed by a\n * contract or other legal act under Union or Member State law, that is binding on the processor with regard to the\n * controller\".\n */\nexport enum DataProcessingAgreementStatus {\n /** A DPA the operator and the processor both signed. */\n SIGNED = \"SIGNED\",\n /** The processor's standard DPA forms part of the terms the operator accepted (the common self-serve case). */\n INCORPORATED_IN_TERMS = \"INCORPORATED_IN_TERMS\",\n /** No DPA governs this processing yet. Stated, so it reads as a gap rather than an omission. */\n NOT_IN_PLACE = \"NOT_IN_PLACE\",\n}\n\n/** The operator's DPA with one processor. See {@link DataProcessingAgreementStatus}. */\nexport const ProcessorDataProcessingAgreementSchema = z.strictObject({\n status: z.enum(DataProcessingAgreementStatus).systemEnum(\"DataProcessingAgreementStatus\"),\n /** When it took effect, `YYYY-MM-DD`, where the operator knows it. */\n effectiveFrom: z.iso.date().optional(),\n /** Where the operator's copy or the incorporated terms can be found — a URL or an internal reference. */\n reference: z.string().trim().min(1).optional(),\n});\nexport type ProcessorDataProcessingAgreement = z.infer<typeof ProcessorDataProcessingAgreementSchema>;\n\nconst ProcessorIdentityFieldsSchema = z.object({\n /**\n * The processor's LEGAL entity — the party a data-protection obligation actually binds.\n *\n * Not the brand. \"Anthropic\" is a product name; a notice, a DPA and a supervisory authority all need\n * the entity that signs.\n */\n legalEntityName: z.string().trim().min(1),\n /**\n * Where this processor processes personal data for this application.\n *\n * A LIST at the processor level rather than per capability. The issue that opened this suggested\n * per-capability regions, \"where a provider offers regional endpoints\" — declined for the reason\n * that settled the retention schedule the same day: an operator decides a small number of things and\n * defends them, and a granularity nobody maintains produces a register that is precise and wrong.\n * An operator using one vendor in two regions declares both, which is what a notice states anyway.\n *\n * Free text rather than a closed vocabulary: region names are genuinely open (`eu-west-1`, `EU`,\n * `Ireland`, `United States`), and a fixed list would be wrong for the next vendor.\n */\n processingRegions: z.array(z.string().trim().min(1)).min(1),\n /**\n * The processor's own subprocessors.\n *\n * EMPTY is a real answer — \"this processor discloses no subprocessors\" — and it is available only\n * because the whole entry is an authored declaration. An operator who has not checked omits the\n * ENTRY, not this field, keeping one clean absence axis: present means established, absent means\n * nobody has looked.\n */\n subprocessors: z.array(ProcessorSubprocessorSchema),\n /** Whether reaching this processor is an international transfer, and under what. See {@link ProcessorTransferDeterminationSchema}. */\n transferDetermination: ProcessorTransferDeterminationSchema.optional(),\n /**\n * The DPA that governs this processing, as THIS operator stands with the processor (#1709). Absent means nobody\n * has recorded it — reported as outstanding by {@link processorAgreementStanding}, never read as \"not required\".\n */\n dataProcessingAgreement: ProcessorDataProcessingAgreementSchema.optional(),\n /**\n * How long the processor keeps the data it receives, in the terms of THIS operator's arrangement (#1709) — \"deleted\n * within 30 days of account termination\". Free text in the processor's words, because retention is set by the\n * contract and the product tier, and differs between two operators of the same vendor. Absent means nobody has\n * recorded it, which {@link processorAgreementStanding} names.\n */\n vendorRetention: z.string().trim().min(1).optional(),\n});\n\n/** One entry in the register — a configured provider, or a subprocessor nothing configures. */\nexport const ApplicationProcessorDeclarationSchema = z.discriminatedUnion(\"kind\", [\n ProcessorIdentityFieldsSchema.extend({\n kind: z.literal(ProcessorRegisterEntryKind.CONFIGURED_PROVIDER).systemEnum('ProcessorRegisterEntryKind'),\n /**\n * The configured provider this describes — the same ref the application's composition uses.\n *\n * Or a `systemsOfRecord` instance name, for the vendor hosting that instance (#2585): the recipient population\n * classes a vendor-hosted instance as an operator sub-processor like any provider, `joinRecipientPopulationToRegister`\n * expects its entry here, and the subject-data recipients take its legal identity from it. A separate entry kind was\n * considered and not added: the instance is addressed by name in the same namespace as providers (the generator\n * refuses a provider named like an instance), so a second arm would restate this one.\n *\n * The join is what makes this arm checkable: a declaration naming a provider the application does\n * not configure describes a relationship it does not have, and a configured provider with no\n * declaration is the gap {@link undeclaredProcessorRefs} reports.\n */\n providerRef: z.string().trim().min(1),\n /**\n * Why this processor is used, where the capability does not already say.\n *\n * OPTIONAL on this arm alone, and the asymmetry is the point: a configured provider's purpose is\n * implied by the capability it serves — `AI_LLM` takes prompt content, `EMAIL` takes recipient\n * addresses — so restating it is a second authority for one fact. Supply it only where the\n * capability under-describes what this particular vendor does for this application.\n */\n purpose: z.string().trim().min(1).optional(),\n }).strict(),\n ProcessorIdentityFieldsSchema.extend({\n kind: z.literal(ProcessorRegisterEntryKind.AUTHORED).systemEnum('ProcessorRegisterEntryKind'),\n /**\n * A stable slug for a subprocessor the configuration never mentions — `hosting`, `cdn`,\n * `support-desk`. Its own key, because there is no `providerRef` to borrow.\n */\n subprocessorRef: z.string().trim().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),\n /**\n * Why this subprocessor is used. REQUIRED here, because nothing else can say.\n *\n * The configured-provider arm can lean on its capability; this arm has no capability, no\n * configuration and no runtime binding to imply anything. Without a purpose the entry is a name\n * and a region, which tells a reader that someone else holds their data and not what for.\n */\n purpose: z.string().trim().min(1),\n }).strict(),\n]);\nexport type ApplicationProcessorDeclaration = z.infer<typeof ApplicationProcessorDeclarationSchema>;\n\n/**\n * The application's accepted processor register.\n *\n * Deliberately NOT requiring an entry per configured provider. Requiring completeness would make the\n * register unauthorable until every vendor had been researched, which is the blocking this whole\n * capability exists to remove — a partial register is useful, and its holes are reported rather than\n * hidden.\n */\nexport const ApplicationProcessorRegisterSchema = z\n .strictObject({\n schemaVersion: z.literal(1),\n processors: z.array(ApplicationProcessorDeclarationSchema),\n /**\n * When the operator last CHECKED this register against the vendors' own pages, and how long it lets that check\n * stand (#1708).\n *\n * A register is a set of vendor facts with a shelf life — sub-processor lists change on a vendor's notice, legal\n * entities reorganise — and until this field the only date anywhere was a comment (\"Verified 2026-09-01\") that\n * nothing could read. With it, {@link complianceFactStaleness} names the register, and every framework-suggested\n * vendor fact, that has outlived the interval the application chose. Reported, never refused.\n *\n * Optional: an absent verification is reported as UNDATED, which is the truthful state of a register nobody has\n * dated. The interval is the application's own policy; the framework supplies no default, because how often a\n * vendor register is re-checked is the operator's answer to its own risk, not a fact the framework holds.\n *\n * Typed by the operator rather than derived, and the derivation was considered: the register file's last commit\n * time is when it last CHANGED, and a re-verification that finds nothing to change leaves no commit. Only the\n * person who checked the vendors' pages can say when they did.\n */\n verification: z\n .strictObject({\n /** The day the operator last checked every entry against the vendor's own pages, `YYYY-MM-DD`. */\n verifiedAt: z.iso.date(),\n /** How many days a check stands before the register — and the vendor facts it relies on — is reported stale. */\n reverificationIntervalDays: z.number().int().positive(),\n })\n .optional(),\n })\n .superRefine((register, context) => {\n /*\n * Uniqueness PER ARM, on each arm's own key.\n *\n * Not one shared namespace: a `providerRef` and a `subprocessorRef` are addresses in different\n * spaces, and colliding them would refuse an application whose hosting company happens to share a\n * slug with a provider it configures — a refusal with no compliance meaning at all.\n */\n const seenProviderRefs = new Set<string>();\n const seenSubprocessorRefs = new Set<string>();\n\n register.processors.forEach((processor, index) => {\n if (processor.kind === ProcessorRegisterEntryKind.CONFIGURED_PROVIDER) {\n if (seenProviderRefs.has(processor.providerRef)) {\n context.addIssue({\n code: \"custom\",\n path: [\"processors\", index, \"providerRef\"],\n message: `\"${processor.providerRef}\" is declared twice; one provider carries one processor identity`,\n });\n }\n seenProviderRefs.add(processor.providerRef);\n return;\n }\n\n if (seenSubprocessorRefs.has(processor.subprocessorRef)) {\n context.addIssue({\n code: \"custom\",\n path: [\"processors\", index, \"subprocessorRef\"],\n message: `\"${processor.subprocessorRef}\" is declared twice; one subprocessor carries one identity`,\n });\n }\n seenSubprocessorRefs.add(processor.subprocessorRef);\n });\n });\nexport type ApplicationProcessorRegister = z.infer<typeof ApplicationProcessorRegisterSchema>;\n/** @wildo_source:part:end saas.specifications.processor-register */\n\n/**\n * Every region personal data reaches THROUGH A DECLARED PROCESSOR, across both arms and their own\n * subprocessors (issue #126).\n *\n * ## What this establishes, and the narrower claim it supports\n *\n * The transfer concern asks whether personal data leaves its origin jurisdiction. That question has\n * three inputs and the framework holds exactly one of them: WHERE declared processors process. The\n * other two — which jurisdiction is the origin, and which mechanism makes a given transfer lawful —\n * are a legal determination with a shelf life, deliberately not modelled (adequacy decisions move by\n * court ruling, so a list baked into the engine would go stale silently and emit a false statement).\n *\n * So this supports one derivable statement and it is narrower than \"no transfers\": when the register\n * declares NO processor at all, no personal data reaches a third party, therefore none is transferred\n * THROUGH ONE. What that does NOT establish is the operator's own processing — its infrastructure,\n * its staff, its own establishment — which is why a document must state the residual rather than\n * round the answer up to \"we do not transfer data internationally\".\n *\n * ## Why subprocessors count\n *\n * A processor's own subprocessors are where data actually lands, and the chain is exactly what makes\n * a transfer statement hard: an operator in France using a French vendor that runs on a US cloud has\n * a transfer, and reading only the vendor's region would miss it. Both levels contribute here for\n * that reason.\n *\n * Regions are returned deduplicated and sorted, so the same register produces the same sentence\n * between runs.\n */\nexport function processorProcessingRegions(\n register: ApplicationProcessorRegister | undefined,\n): readonly string[] {\n const regions = (register?.processors ?? []).flatMap((processor) => [\n ...processor.processingRegions,\n ...processor.subprocessors.flatMap((subprocessor) => subprocessor.processingRegions),\n ]);\n return [...new Set(regions)].sort();\n}\n\n/**\n * True when the register establishes that NO processor receives personal data.\n *\n * The one transfer statement derivable without a jurisdiction comparison, and it is deliberately\n * about the REGISTER rather than about the world: an EMPTY register means the operator declared no\n * processors, while an ABSENT register means nobody has looked. Those are opposite states and the\n * function refuses to conflate them — absent returns `false`, because \"nobody checked\" must never\n * produce \"nothing is transferred\".\n *\n * That distinction is the whole reason the register's own schema does not require an entry per\n * configured provider: a partial register is useful and its holes are reported, but a MISSING one\n * cannot support a negative claim about anything.\n */\nexport function registerEstablishesNoProcessorRecipients(\n register: ApplicationProcessorRegister | undefined,\n): boolean {\n return register !== undefined && register.processors.length === 0;\n}\n\n/**\n * The entries that JOIN to a configured provider — the only arm either gap function can reason about.\n *\n * Both functions compare the register against the application's configured provider set, and an\n * AUTHORED entry is by construction not in that set: nothing configures the operator's hosting\n * company. Before the register grew its second arm they iterated every entry and read `providerRef`\n * off it, which the compiler now refuses — and rightly, because the answer would have been wrong in\n * both directions at once. Every authored entry would have been reported as \"naming a provider the\n * application does not configure\", and the real gap list would have been drowned in false ones.\n *\n * Extracted rather than inlined twice so the two functions cannot drift about what they are\n * comparing.\n */\nfunction configuredProviderEntries(\n register: ApplicationProcessorRegister | undefined,\n): ReadonlyArray<Extract<ApplicationProcessorDeclaration, { kind: ProcessorRegisterEntryKind.CONFIGURED_PROVIDER }>> {\n return (register?.processors ?? []).filter(\n (processor): processor is Extract<ApplicationProcessorDeclaration, { kind: ProcessorRegisterEntryKind.CONFIGURED_PROVIDER }> =>\n processor.kind === ProcessorRegisterEntryKind.CONFIGURED_PROVIDER,\n );\n}\n\n/**\n * Configured providers the register does not account for — the gap, per provider.\n *\n * Takes the configured set as an argument rather than reading it, so the same function serves the\n * companion (which reads the live composition) and a test (which supplies one). Order follows the\n * CONFIGURED list, so the answer is stable and reads like the composition it is about.\n */\nexport function undeclaredProcessorRefs(\n configuredProviderRefs: readonly string[],\n register: ApplicationProcessorRegister | undefined,\n): readonly string[] {\n const declared = new Set(configuredProviderEntries(register).map((processor) => processor.providerRef));\n return configuredProviderRefs.filter((providerRef) => !declared.has(providerRef));\n}\n\n/**\n * Declared processors naming a provider the application does not configure.\n *\n * The opposite error, and it is quieter: an entry left behind after a vendor was dropped keeps a\n * recipient in the notice that receives nothing. Reported rather than refused — a register is edited\n * by hand, and a stale entry is a thing to notice, not a reason to reject the file.\n */\nexport function processorRefsNotConfigured(\n configuredProviderRefs: readonly string[],\n register: ApplicationProcessorRegister | undefined,\n): readonly string[] {\n const configured = new Set(configuredProviderRefs);\n return configuredProviderEntries(register)\n .map((processor) => processor.providerRef)\n .filter((providerRef) => !configured.has(providerRef));\n}\n\n/*\n * WHICH configured providers are recipients, and which of those the register has not established, is no longer\n * answered here. `classifyConfiguredProviderRecipients` took the population as a list of refs, and its three\n * readers each built that list differently — capability-bearing providers only in the evidence collector, top-level\n * runtime scopes only in the brief and the computed facts, systems of record in none (#1707). The population and\n * its join to this register are now ONE function pair in `recipient-population.schemas.ts`:\n * `computeRecipientPopulation` and `joinRecipientPopulationToRegister`.\n */\n\n/**\n * Whether a dated compliance fact is still inside the interval the application declared (#1708).\n */\nexport enum ComplianceFactCurrency {\n /** Checked within the declared interval. */\n CURRENT = \"CURRENT\",\n /** Checked longer ago than the declared interval: re-check it against the vendor's page. */\n STALE = \"STALE\",\n /** Carries no date at all, so its age cannot be known. */\n UNDATED = \"UNDATED\",\n /** Dated, but the application declares no interval, so nothing says how old is too old. */\n NO_INTERVAL_DECLARED = \"NO_INTERVAL_DECLARED\",\n}\n\n/** One dated fact's currency. */\nexport interface ComplianceFactAge {\n readonly verifiedAt: string | null;\n readonly ageDays: number | null;\n readonly currency: ComplianceFactCurrency;\n}\n\n/** The staleness report: the register's own date, and every established vendor profile a reader relies on. */\nexport interface ComplianceFactStalenessReport {\n readonly asOf: string;\n readonly reverificationIntervalDays: number | null;\n readonly register: ComplianceFactAge;\n /** Per provider ref with an ESTABLISHED profile, dated by its OLDEST evidence. Sorted by ref. */\n readonly providerProfiles: readonly ({ readonly providerRef: string } & ComplianceFactAge)[];\n /** True when the register's own verification is {@link ComplianceFactCurrency.STALE}. */\n readonly registerStale: boolean;\n /** The provider refs whose profile is {@link ComplianceFactCurrency.STALE}. */\n readonly staleProviderRefs: readonly string[];\n /** The provider refs whose ESTABLISHED profile cites no evidence at all, so its age cannot be known. */\n readonly undatedProviderRefs: readonly string[];\n}\n\nconst MILLISECONDS_PER_DAY = 86_400_000;\n\nfunction ageOf(verifiedAt: string | null, asOf: string, intervalDays: number | null): ComplianceFactAge {\n if (verifiedAt === null) return { verifiedAt, ageDays: null, currency: ComplianceFactCurrency.UNDATED };\n const ageDays = Math.floor((Date.parse(`${asOf}T00:00:00Z`) - Date.parse(`${verifiedAt}T00:00:00Z`)) / MILLISECONDS_PER_DAY);\n if (intervalDays === null) return { verifiedAt, ageDays, currency: ComplianceFactCurrency.NO_INTERVAL_DECLARED };\n return { verifiedAt, ageDays, currency: ageDays > intervalDays ? ComplianceFactCurrency.STALE : ComplianceFactCurrency.CURRENT };\n}\n\n/**\n * Which compliance facts have outlived the interval the application declared (#1708) — DERIVED, never asked.\n *\n * Two populations, one interval: the operator's own register (its `verification.verifiedAt`) and the vendor facts\n * the framework suggests (each established profile's oldest `evidence[].verifiedAt`). The interval is the register's\n * `reverificationIntervalDays`, because how old is too old is the operator's policy for both; with none declared,\n * ages are still reported and nothing is called stale.\n *\n * `asOf` is a `YYYY-MM-DD` day supplied by the caller (the run's own instant), so the report is a pure function of\n * its inputs and a test can pin it. A report, never a refusal (`application-creation-directive.md`).\n *\n * assurance-control: WILDO.PRIVACY.THIRD_PARTY_PROCESSING — processor facts older than the operator's own\n * re-verification interval are named, so a notice does not keep stating a vendor arrangement nobody re-checked.\n */\nexport function complianceFactStaleness(params: {\n readonly register: ApplicationProcessorRegister | undefined;\n readonly profilesByProviderRef: Readonly<Record<string, ProviderComplianceProfile>>;\n /** The provider refs a reader relies on — the population's members. Profiles of other refs are not reported. */\n readonly providerRefs: readonly string[];\n readonly asOf: string;\n}): ComplianceFactStalenessReport {\n const intervalDays = params.register?.verification?.reverificationIntervalDays ?? null;\n const register = ageOf(params.register?.verification?.verifiedAt ?? null, params.asOf, intervalDays);\n const providerProfiles = [...new Set(params.providerRefs)].sort().flatMap((providerRef) => {\n const established = establishedProviderComplianceProfile(params.profilesByProviderRef[providerRef]);\n return established === null ? [] : [{ providerRef, ...ageOf(oldestProviderComplianceEvidenceDate(established), params.asOf, intervalDays) }];\n });\n return {\n asOf: params.asOf,\n reverificationIntervalDays: intervalDays,\n register,\n providerProfiles,\n registerStale: register.currency === ComplianceFactCurrency.STALE,\n staleProviderRefs: providerProfiles.filter((entry) => entry.currency === ComplianceFactCurrency.STALE).map((entry) => entry.providerRef),\n undatedProviderRefs: providerProfiles.filter((entry) => entry.currency === ComplianceFactCurrency.UNDATED).map((entry) => entry.providerRef),\n };\n}\n\n/** One register entry's contractual standing: its DPA and its recorded retention, as the operator stated them. */\nexport interface ProcessorAgreementStandingEntry {\n /** `providerRef` for a configured provider, `subprocessorRef` for an authored entry. */\n readonly ref: string;\n readonly entryKind: ProcessorRegisterEntryKind;\n /** `null` when the operator has not recorded a DPA — outstanding, never \"not required\". */\n readonly dataProcessingAgreement: DataProcessingAgreementStatus | null;\n readonly vendorRetention: string | null;\n}\n\n/** Which processors are governed by a recorded agreement, and which are not (#1709). */\nexport interface ProcessorAgreementStandingReport {\n /** Every register entry, sorted by ref. */\n readonly entries: readonly ProcessorAgreementStandingEntry[];\n /** Entries with NO DPA recorded — the question is open. */\n readonly agreementUnrecordedRefs: readonly string[];\n /** Entries the operator states have NO DPA in place — an Art. 28(3) gap, stated as such. */\n readonly agreementNotInPlaceRefs: readonly string[];\n /** Entries with no vendor retention recorded. */\n readonly vendorRetentionUnrecordedRefs: readonly string[];\n}\n\n/**\n * The register's contractual standing — which processors a recorded DPA governs, which the operator says none does,\n * and which nobody has recorded (#1709).\n *\n * Only the operator can know whether it is bound by a DPA, so this READS what the register states and names what it\n * does not; it never infers a status from a vendor offering one. An absent register yields an empty report — the\n * missing register is already named by the population join, and saying it twice would read as two findings.\n *\n * A report, never a refusal (`application-creation-directive.md`): a processing activity with no DPA is the\n * operator's gap to close, and naming it is what lets them.\n *\n * spec-cite: GDPR Art. 28(3), https://gdpr-info.eu/art-28-gdpr/ — \"Processing by a processor shall be governed by a\n * contract or other legal act under Union or Member State law, that is binding on the processor with regard to the\n * controller\".\n *\n * assurance-control: WILDO.PRIVACY.THIRD_PARTY_PROCESSING — a processor with no recorded or no in-place DPA is named,\n * so an unrecorded contractual basis does not read as a governed one.\n */\nexport function processorAgreementStanding(register: ApplicationProcessorRegister | undefined): ProcessorAgreementStandingReport {\n const entries = (register?.processors ?? [])\n .map((processor): ProcessorAgreementStandingEntry => ({\n ref: processor.kind === ProcessorRegisterEntryKind.CONFIGURED_PROVIDER ? processor.providerRef : processor.subprocessorRef,\n entryKind: processor.kind,\n dataProcessingAgreement: processor.dataProcessingAgreement?.status ?? null,\n vendorRetention: processor.vendorRetention ?? null,\n }))\n .sort((left, right) => left.ref.localeCompare(right.ref));\n return {\n entries,\n agreementUnrecordedRefs: entries.filter((entry) => entry.dataProcessingAgreement === null).map((entry) => entry.ref),\n agreementNotInPlaceRefs: entries.filter((entry) => entry.dataProcessingAgreement === DataProcessingAgreementStatus.NOT_IN_PLACE).map((entry) => entry.ref),\n vendorRetentionUnrecordedRefs: entries.filter((entry) => entry.vendorRetention === null).map((entry) => entry.ref),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"processor-register.schemas.js","sourceRoot":"","sources":["../../../../src/_core/compliance-documents/processor-register.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,6GAA6G;AAC7G,+GAA+G;AAC/G,OAAO,0BAA0B,CAAC;AAClC,OAAO,EACL,oCAAoC,EACpC,oCAAoC,GAErC,MAAM,uBAAuB,CAAC;AAE/B,sHAAsH;AACtH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;QAC1J,6BAA6B,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;KACnH,CAAC;AACJ,CAAC","sourcesContent":["import { z } from \"zod\";\n// Side-effect import: this module calls `.systemEnum()` at load, so the decorators must be installed first —\n// never by the importer's luck (#966). A named import used only as a type would be elided and install nothing.\nimport '@wildo-ai/zod-decorators';\nimport {\n establishedProviderComplianceProfile,\n oldestProviderComplianceEvidenceDate,\n type ProviderComplianceProfile,\n} from '@wildo-ai/saas-models';\n\n/** @wildo_source:part:start saas.specifications.processor-register facet:layer:shared facet:audience:app-developer */\n/**\n * **Who else processes personal data, under what legal identity, and where.**\n *\n * ## The gap this closes\n *\n * A configured provider establishes THAT a third party is involved and WHAT FUNCTION it performs —\n * `EngineCapability` gives email delivery, storage, payments, LLM inference, observability. It gives\n * none of the three things a reader of a privacy notice needs: the processor's legal identity, the\n * region it processes in, and its own subprocessors (issue #88).\n *\n * That gap blocks two concerns rather than one, and the second cannot be answered independently: an\n * international-transfer statement is a statement about WHERE a recipient processes, so a provider\n * carrying no region cannot support one.\n *\n * ## Declared by the APPLICATION, not derived from the provider\n *\n * A provider's legal entity is a fact about a vendor, and it is tempting to put it on the provider\n * definition so every application inherits it. It is not carried there, deliberately: what a document\n * must state is the arrangement THIS operator has — which vendor, in which region, under which\n * contract — and two applications using the same vendor can honestly differ on all three. A\n * framework-supplied identity would also be a fact the framework cannot keep true: vendors reorganise,\n * and a stale legal entity in a published notice is worse than an absent one.\n *\n * So the register is authored beside the application's other specifications and read from there. What\n * the framework contributes is the QUESTION and the gap report, never the answer.\n *\n * ## Researched vendor facts are SUGGESTIONS, adopted only by the operator's commit (decided 2026-09-25, #1744)\n *\n * The framework does research the vendors applications actually declare — legal entity, processing regions,\n * sub-processor list, data processing agreement — and ships each fact on the provider's compliance profile with the\n * page it was read from and the date (`evidence`, #1708). Those facts are SUGGESTIONS: the brief offers them beside an\n * undeclared entry as the question to answer, and nothing reaches a document until the operator checks the page,\n * copies the fact into THIS register and commits it. The commit is the adoption (`one-source-of-truth.md` rule 2);\n * the framework's statement stays \"this is what we read, on this date, at this URL\". Rejected: publishing the facts\n * straight into computed document facts, which would make the framework the author of a legal statement in someone\n * else's notice, and could not be walked back once a notice carried it; and shipping no facts at all, which leaves\n * every operator to research every vendor alone. A stale suggestion is caught by `complianceFactStaleness`.\n *\n * ## Absence is a gap with a NAME, because the configured set is already known\n *\n * The application's composition already lists its configured providers. Comparing that list against\n * this register turns \"processor identities are not established\" into \"`anthropic` is configured and\n * undeclared\" — a gap an operator can act on, per provider, rather than a sentence they cannot.\n *\n * See {@link undeclaredProcessorRefs}. An entry ABSENT from the register means nobody has established\n * that processor's identity; it never means the provider is not in use.\n */\n\n/**\n * One subprocessor a declared processor uses in turn.\n *\n * Carried because a privacy notice's recipient statement is only as true as its deepest hop: a\n * customer's data reaching a vendor's own hosting provider is a disclosure, and a notice naming only\n * the first hop understates who holds the data.\n */\nexport const ProcessorSubprocessorSchema = z.strictObject({\n /** The subprocessor's name as the processor discloses it. */\n name: z.string().trim().min(1),\n /**\n * Where this subprocessor processes, as the processor discloses it.\n *\n * Required: a subprocessor with no location cannot support the transfer statement that is the whole\n * reason for following the chain this far.\n */\n processingRegions: z.array(z.string().trim().min(1)).min(1),\n});\nexport type ProcessorSubprocessor = z.infer<typeof ProcessorSubprocessorSchema>;\n\n/**\n * WHICH KIND of subprocessor an entry describes.\n *\n * **Providers are a SUBSET of subprocessors, and this register was built as if they were the whole\n * set.** Every entry keyed on `providerRef` and the schema enforced one entry per provider, which\n * made it structurally unable to hold a subprocessor the application does not configure as a\n * provider — a hosting company, a CDN, a support tool, an accountant. Those are processors under\n * Art. 28 and belong in the same register a notice reads (issue #130).\n *\n * The discriminator exists because the two arms differ in what can be CHECKED, not merely in shape.\n * A configured-provider entry joins to the application's composition, so a claim about a provider it\n * does not configure is detectable and a configured provider with no entry is a reportable gap. An\n * authored entry joins to nothing: no configuration mentions the operator's hosting company, so the\n * framework can neither confirm it nor notice its absence. Collapsing them would present an\n * unverifiable claim with the same authority as a checkable one.\n */\nexport enum ProcessorRegisterEntryKind {\n /**\n * A provider the application configures, or the vendor of a vendor-hosted system-of-record instance (keyed by the\n * instance name, #2585). Joins to `providerRef`, and its absence is reportable.\n */\n CONFIGURED_PROVIDER = \"CONFIGURED_PROVIDER\",\n /** A subprocessor nothing in the configuration mentions. Unverifiable by construction, and stated as authored. */\n AUTHORED = \"AUTHORED\",\n}\n\n/**\n * The instrument that makes a transfer of personal data out of its origin jurisdiction lawful.\n *\n * spec-cite: GDPR Chapter V — Art. 45 (adequacy), Art. 46(2)(b)–(f) (appropriate safeguards), Art. 47 (binding\n * corporate rules), Art. 49(1) (derogations). The UK GDPR keeps the same structure, so one vocabulary serves\n * both; the INSTRUMENT that fills a member differs by jurisdiction (the EU clauses, the UK Addendum), which is\n * why each safeguard names its instrument in prose beside the member.\n *\n * Recorded, never computed (#126): which mechanism applies is a legal determination with a shelf life —\n * an adequacy decision can be struck down while the vendor stays where it is — so the framework offers the\n * place to write it down and derives nothing from a region.\n */\nexport enum InternationalTransferMechanism {\n /** Art. 45 — the destination is covered by an adequacy decision (for the United States, the Data Privacy Framework, for a certified recipient). */\n ADEQUACY_DECISION = \"ADEQUACY_DECISION\",\n /** Art. 46(2)(c)/(d) — standard data protection clauses, or a jurisdiction's equivalent (the UK Addendum to them). */\n STANDARD_CONTRACTUAL_CLAUSES = \"STANDARD_CONTRACTUAL_CLAUSES\",\n /** Art. 46(2)(b) and Art. 47 — binding corporate rules approved for the recipient's group. */\n BINDING_CORPORATE_RULES = \"BINDING_CORPORATE_RULES\",\n /** Art. 46(2)(e) — an approved code of conduct with binding commitments of the recipient. */\n APPROVED_CODE_OF_CONDUCT = \"APPROVED_CODE_OF_CONDUCT\",\n /** Art. 46(2)(f) — an approved certification with binding commitments of the recipient. */\n APPROVED_CERTIFICATION = \"APPROVED_CERTIFICATION\",\n /** Art. 49 — a derogation for a specific situation. Requires {@link InternationalTransferDerogation}. */\n DEROGATION = \"DEROGATION\",\n}\n\n/** Which Art. 49 derogation a {@link InternationalTransferMechanism.DEROGATION} relies on. spec-cite: GDPR Art. 49(1). */\nexport enum InternationalTransferDerogation {\n /** Art. 49(1)(a) — explicit consent after being informed of the risks. */\n EXPLICIT_CONSENT = \"EXPLICIT_CONSENT\",\n /** Art. 49(1)(b) — necessary for a contract with the data subject. */\n CONTRACT_WITH_SUBJECT = \"CONTRACT_WITH_SUBJECT\",\n /** Art. 49(1)(c) — necessary for a contract concluded in the subject's interest with another party. */\n CONTRACT_IN_SUBJECT_INTEREST = \"CONTRACT_IN_SUBJECT_INTEREST\",\n /** Art. 49(1)(d) — important reasons of public interest. */\n PUBLIC_INTEREST = \"PUBLIC_INTEREST\",\n /** Art. 49(1)(e) — establishment, exercise or defence of legal claims. */\n LEGAL_CLAIMS = \"LEGAL_CLAIMS\",\n /** Art. 49(1)(f) — vital interests where the subject cannot consent. */\n VITAL_INTERESTS = \"VITAL_INTERESTS\",\n /** Art. 49(1)(g) — a transfer from a public register. */\n PUBLIC_REGISTER = \"PUBLIC_REGISTER\",\n /** Art. 49(1), second subparagraph — compelling legitimate interests, for a non-repetitive transfer. */\n COMPELLING_LEGITIMATE_INTERESTS = \"COMPELLING_LEGITIMATE_INTERESTS\",\n}\n\n/**\n * Whether reaching this processor moves personal data out of the jurisdiction it came from.\n *\n * A DETERMINATION, recorded by the operator, because regions are free text: nothing can compare\n * `United States` or `eu-west-1` with a declared operating jurisdiction, so the framework cannot tell a\n * domestic processor from a foreign one and does not guess.\n */\nexport enum ProcessorTransferDeterminationKind {\n /** Every region this processor (and its subprocessors) uses lies within the jurisdictions the data comes from. */\n NO_TRANSFER = \"NO_TRANSFER\",\n /** Personal data leaves its origin jurisdiction to reach this processor, under the safeguards named. */\n TRANSFER = \"TRANSFER\",\n}\n\n/** The safeguard one origin jurisdiction's data travels under. */\nexport const ProcessorTransferSafeguardSchema = z\n .strictObject({\n /** The jurisdiction the data leaves — one of the application's `operatingJurisdictions`. */\n originJurisdictionSlug: z.string().trim().min(1),\n mechanism: z.enum(InternationalTransferMechanism).systemEnum(\"InternationalTransferMechanism\"),\n /** Required with {@link InternationalTransferMechanism.DEROGATION}, refused otherwise. */\n derogation: z.enum(InternationalTransferDerogation).systemEnum(\"InternationalTransferDerogation\").optional(),\n /**\n * The instrument, as a reader could look it up: \"EU SCCs (Commission Decision 2021/914), Module Two\",\n * \"UK Addendum to the EU SCCs\", \"EU-US Data Privacy Framework — recipient certified\". A mechanism\n * member alone tells a reader the article, not the document that binds the recipient.\n */\n instrument: z.string().trim().min(1),\n })\n .superRefine((safeguard, context) => {\n const isDerogation = safeguard.mechanism === InternationalTransferMechanism.DEROGATION;\n if (isDerogation !== (safeguard.derogation !== undefined)) {\n context.addIssue({\n code: \"custom\",\n path: [\"derogation\"],\n message: isDerogation ? \"a derogation must name which Art. 49 ground it relies on\" : \"only a DEROGATION mechanism names a derogation\",\n });\n }\n });\nexport type ProcessorTransferSafeguard = z.infer<typeof ProcessorTransferSafeguardSchema>;\n\n/**\n * The operator's transfer determination for one register entry.\n *\n * Carried by the ENTRY, not the provider, and not per subprocessor: a vendor's regions change when it opens\n * a data centre, a mechanism changes when a court rules, and the processor's own contract is what binds its\n * onward transfers to its subprocessors — so the determination for reaching this processor covers the chain\n * behind it. It is OPTIONAL, and absence means \"not determined\": the `international-transfers` fact then\n * answers nothing, because a register with an undetermined entry cannot support either \"no transfer\" or a\n * list of safeguards.\n */\nexport const ProcessorTransferDeterminationSchema = z.discriminatedUnion(\"kind\", [\n z.strictObject({\n kind: z.literal(ProcessorTransferDeterminationKind.NO_TRANSFER).systemEnum(\"ProcessorTransferDeterminationKind\"),\n /** Why none of the regions is outside the origin jurisdictions — the comparison the framework cannot make. */\n rationale: z.string().trim().min(1),\n }),\n z\n .strictObject({\n kind: z.literal(ProcessorTransferDeterminationKind.TRANSFER).systemEnum(\"ProcessorTransferDeterminationKind\"),\n /** One safeguard per origin jurisdiction whose data reaches this processor. */\n safeguards: z.array(ProcessorTransferSafeguardSchema).min(1),\n })\n .superRefine((determination, context) => {\n const origins = determination.safeguards.map((safeguard) => safeguard.originJurisdictionSlug);\n if (new Set(origins).size !== origins.length) {\n context.addIssue({ code: \"custom\", path: [\"safeguards\"], message: \"one safeguard per origin jurisdiction\" });\n }\n }),\n]);\nexport type ProcessorTransferDetermination = z.infer<typeof ProcessorTransferDeterminationSchema>;\n\n/**\n * Whether THIS operator has a data processing agreement with the processor — the operator's fact, never the vendor's\n * (#1709). A vendor OFFERING a DPA is a suggestion its compliance profile may carry (`dataProcessingAgreementUrl`);\n * whether this operator is bound by one is not something the framework can know.\n *\n * spec-cite: GDPR Art. 28(3), https://gdpr-info.eu/art-28-gdpr/ — \"Processing by a processor shall be governed by a\n * contract or other legal act under Union or Member State law, that is binding on the processor with regard to the\n * controller\".\n */\nexport enum DataProcessingAgreementStatus {\n /** A DPA the operator and the processor both signed. */\n SIGNED = \"SIGNED\",\n /** The processor's standard DPA forms part of the terms the operator accepted (the common self-serve case). */\n INCORPORATED_IN_TERMS = \"INCORPORATED_IN_TERMS\",\n /** No DPA governs this processing yet. Stated, so it reads as a gap rather than an omission. */\n NOT_IN_PLACE = \"NOT_IN_PLACE\",\n}\n\n/** The operator's DPA with one processor. See {@link DataProcessingAgreementStatus}. */\nexport const ProcessorDataProcessingAgreementSchema = z.strictObject({\n status: z.enum(DataProcessingAgreementStatus).systemEnum(\"DataProcessingAgreementStatus\"),\n /** When it took effect, `YYYY-MM-DD`, where the operator knows it. */\n effectiveFrom: z.iso.date().optional(),\n /** Where the operator's copy or the incorporated terms can be found — a URL or an internal reference. */\n reference: z.string().trim().min(1).optional(),\n});\nexport type ProcessorDataProcessingAgreement = z.infer<typeof ProcessorDataProcessingAgreementSchema>;\n\nconst ProcessorIdentityFieldsSchema = z.object({\n /**\n * The processor's LEGAL entity — the party a data-protection obligation actually binds.\n *\n * Not the brand. \"Anthropic\" is a product name; a notice, a DPA and a supervisory authority all need\n * the entity that signs.\n */\n legalEntityName: z.string().trim().min(1),\n /**\n * Where this processor processes personal data for this application.\n *\n * A LIST at the processor level rather than per capability. The issue that opened this suggested\n * per-capability regions, \"where a provider offers regional endpoints\" — declined for the reason\n * that settled the retention schedule the same day: an operator decides a small number of things and\n * defends them, and a granularity nobody maintains produces a register that is precise and wrong.\n * An operator using one vendor in two regions declares both, which is what a notice states anyway.\n *\n * Free text rather than a closed vocabulary: region names are genuinely open (`eu-west-1`, `EU`,\n * `Ireland`, `United States`), and a fixed list would be wrong for the next vendor.\n */\n processingRegions: z.array(z.string().trim().min(1)).min(1),\n /**\n * Where this processor keeps the data AT REST, when that differs from where it processes it (#3921): a vendor admitted\n * on the application's opt-in at-rest residency stores in one place and processes in another, and a register that\n * named only the processing region could not say the half a reader of the weaker promise needs.\n *\n * In the operator's words, like {@link processingRegions}. The framework SUGGESTS it from the vendor profile's storage\n * map for the chosen region, and the operator adopts it by committing it here, like every other vendor fact (#1744).\n * Absent means not stated; the international-transfers fact names every `inside-at-rest` provider whose entry lacks it.\n */\n storedAtRestIn: z.array(z.string().trim().min(1)).min(1).optional(),\n /**\n * The processor's own subprocessors.\n *\n * EMPTY is a real answer — \"this processor discloses no subprocessors\" — and it is available only\n * because the whole entry is an authored declaration. An operator who has not checked omits the\n * ENTRY, not this field, keeping one clean absence axis: present means established, absent means\n * nobody has looked.\n */\n subprocessors: z.array(ProcessorSubprocessorSchema),\n /** Whether reaching this processor is an international transfer, and under what. See {@link ProcessorTransferDeterminationSchema}. */\n transferDetermination: ProcessorTransferDeterminationSchema.optional(),\n /**\n * The DPA that governs this processing, as THIS operator stands with the processor (#1709). Absent means nobody\n * has recorded it — reported as outstanding by {@link processorAgreementStanding}, never read as \"not required\".\n */\n dataProcessingAgreement: ProcessorDataProcessingAgreementSchema.optional(),\n /**\n * How long the processor keeps the data it receives, in the terms of THIS operator's arrangement (#1709) — \"deleted\n * within 30 days of account termination\". Free text in the processor's words, because retention is set by the\n * contract and the product tier, and differs between two operators of the same vendor. Absent means nobody has\n * recorded it, which {@link processorAgreementStanding} names.\n */\n vendorRetention: z.string().trim().min(1).optional(),\n});\n\n/** One entry in the register — a configured provider, or a subprocessor nothing configures. */\nexport const ApplicationProcessorDeclarationSchema = z.discriminatedUnion(\"kind\", [\n ProcessorIdentityFieldsSchema.extend({\n kind: z.literal(ProcessorRegisterEntryKind.CONFIGURED_PROVIDER).systemEnum('ProcessorRegisterEntryKind'),\n /**\n * The configured provider this describes — the same ref the application's composition uses.\n *\n * Or a `systemsOfRecord` instance name, for the vendor hosting that instance (#2585): the recipient population\n * classes a vendor-hosted instance as an operator sub-processor like any provider, `joinRecipientPopulationToRegister`\n * expects its entry here, and the subject-data recipients take its legal identity from it. A separate entry kind was\n * considered and not added: the instance is addressed by name in the same namespace as providers (the generator\n * refuses a provider named like an instance), so a second arm would restate this one.\n *\n * The join is what makes this arm checkable: a declaration naming a provider the application does\n * not configure describes a relationship it does not have, and a configured provider with no\n * declaration is the gap {@link undeclaredProcessorRefs} reports.\n */\n providerRef: z.string().trim().min(1),\n /**\n * Why this processor is used, where the capability does not already say.\n *\n * OPTIONAL on this arm alone, and the asymmetry is the point: a configured provider's purpose is\n * implied by the capability it serves — `AI_LLM` takes prompt content, `EMAIL` takes recipient\n * addresses — so restating it is a second authority for one fact. Supply it only where the\n * capability under-describes what this particular vendor does for this application.\n */\n purpose: z.string().trim().min(1).optional(),\n }).strict(),\n ProcessorIdentityFieldsSchema.extend({\n kind: z.literal(ProcessorRegisterEntryKind.AUTHORED).systemEnum('ProcessorRegisterEntryKind'),\n /**\n * A stable slug for a subprocessor the configuration never mentions — `hosting`, `cdn`,\n * `support-desk`. Its own key, because there is no `providerRef` to borrow.\n */\n subprocessorRef: z.string().trim().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),\n /**\n * Why this subprocessor is used. REQUIRED here, because nothing else can say.\n *\n * The configured-provider arm can lean on its capability; this arm has no capability, no\n * configuration and no runtime binding to imply anything. Without a purpose the entry is a name\n * and a region, which tells a reader that someone else holds their data and not what for.\n */\n purpose: z.string().trim().min(1),\n }).strict(),\n]);\nexport type ApplicationProcessorDeclaration = z.infer<typeof ApplicationProcessorDeclarationSchema>;\n\n/**\n * The application's accepted processor register.\n *\n * Deliberately NOT requiring an entry per configured provider. Requiring completeness would make the\n * register unauthorable until every vendor had been researched, which is the blocking this whole\n * capability exists to remove — a partial register is useful, and its holes are reported rather than\n * hidden.\n */\nexport const ApplicationProcessorRegisterSchema = z\n .strictObject({\n schemaVersion: z.literal(1),\n processors: z.array(ApplicationProcessorDeclarationSchema),\n /**\n * When the operator last CHECKED this register against the vendors' own pages, and how long it lets that check\n * stand (#1708).\n *\n * A register is a set of vendor facts with a shelf life — sub-processor lists change on a vendor's notice, legal\n * entities reorganise — and until this field the only date anywhere was a comment (\"Verified 2026-09-01\") that\n * nothing could read. With it, {@link complianceFactStaleness} names the register, and every framework-suggested\n * vendor fact, that has outlived the interval the application chose. Reported, never refused.\n *\n * Optional: an absent verification is reported as UNDATED, which is the truthful state of a register nobody has\n * dated. The interval is the application's own policy; the framework supplies no default, because how often a\n * vendor register is re-checked is the operator's answer to its own risk, not a fact the framework holds.\n *\n * Typed by the operator rather than derived, and the derivation was considered: the register file's last commit\n * time is when it last CHANGED, and a re-verification that finds nothing to change leaves no commit. Only the\n * person who checked the vendors' pages can say when they did.\n */\n verification: z\n .strictObject({\n /** The day the operator last checked every entry against the vendor's own pages, `YYYY-MM-DD`. */\n verifiedAt: z.iso.date(),\n /** How many days a check stands before the register — and the vendor facts it relies on — is reported stale. */\n reverificationIntervalDays: z.number().int().positive(),\n })\n .optional(),\n })\n .superRefine((register, context) => {\n /*\n * Uniqueness PER ARM, on each arm's own key.\n *\n * Not one shared namespace: a `providerRef` and a `subprocessorRef` are addresses in different\n * spaces, and colliding them would refuse an application whose hosting company happens to share a\n * slug with a provider it configures — a refusal with no compliance meaning at all.\n */\n const seenProviderRefs = new Set<string>();\n const seenSubprocessorRefs = new Set<string>();\n\n register.processors.forEach((processor, index) => {\n if (processor.kind === ProcessorRegisterEntryKind.CONFIGURED_PROVIDER) {\n if (seenProviderRefs.has(processor.providerRef)) {\n context.addIssue({\n code: \"custom\",\n path: [\"processors\", index, \"providerRef\"],\n message: `\"${processor.providerRef}\" is declared twice; one provider carries one processor identity`,\n });\n }\n seenProviderRefs.add(processor.providerRef);\n return;\n }\n\n if (seenSubprocessorRefs.has(processor.subprocessorRef)) {\n context.addIssue({\n code: \"custom\",\n path: [\"processors\", index, \"subprocessorRef\"],\n message: `\"${processor.subprocessorRef}\" is declared twice; one subprocessor carries one identity`,\n });\n }\n seenSubprocessorRefs.add(processor.subprocessorRef);\n });\n });\nexport type ApplicationProcessorRegister = z.infer<typeof ApplicationProcessorRegisterSchema>;\n/** @wildo_source:part:end saas.specifications.processor-register */\n\n/**\n * Every region personal data reaches THROUGH A DECLARED PROCESSOR, across both arms and their own\n * subprocessors (issue #126).\n *\n * ## What this establishes, and the narrower claim it supports\n *\n * The transfer concern asks whether personal data leaves its origin jurisdiction. That question has\n * three inputs and the framework holds exactly one of them: WHERE declared processors process. The\n * other two — which jurisdiction is the origin, and which mechanism makes a given transfer lawful —\n * are a legal determination with a shelf life, deliberately not modelled (adequacy decisions move by\n * court ruling, so a list baked into the engine would go stale silently and emit a false statement).\n *\n * So this supports one derivable statement and it is narrower than \"no transfers\": when the register\n * declares NO processor at all, no personal data reaches a third party, therefore none is transferred\n * THROUGH ONE. What that does NOT establish is the operator's own processing — its infrastructure,\n * its staff, its own establishment — which is why a document must state the residual rather than\n * round the answer up to \"we do not transfer data internationally\".\n *\n * ## Why subprocessors count\n *\n * A processor's own subprocessors are where data actually lands, and the chain is exactly what makes\n * a transfer statement hard: an operator in France using a French vendor that runs on a US cloud has\n * a transfer, and reading only the vendor's region would miss it. Both levels contribute here for\n * that reason.\n *\n * Regions are returned deduplicated and sorted, so the same register produces the same sentence\n * between runs.\n */\nexport function processorProcessingRegions(\n register: ApplicationProcessorRegister | undefined,\n): readonly string[] {\n const regions = (register?.processors ?? []).flatMap((processor) => [\n ...processor.processingRegions,\n ...processor.subprocessors.flatMap((subprocessor) => subprocessor.processingRegions),\n ]);\n return [...new Set(regions)].sort();\n}\n\n/**\n * True when the register establishes that NO processor receives personal data.\n *\n * The one transfer statement derivable without a jurisdiction comparison, and it is deliberately\n * about the REGISTER rather than about the world: an EMPTY register means the operator declared no\n * processors, while an ABSENT register means nobody has looked. Those are opposite states and the\n * function refuses to conflate them — absent returns `false`, because \"nobody checked\" must never\n * produce \"nothing is transferred\".\n *\n * That distinction is the whole reason the register's own schema does not require an entry per\n * configured provider: a partial register is useful and its holes are reported, but a MISSING one\n * cannot support a negative claim about anything.\n */\nexport function registerEstablishesNoProcessorRecipients(\n register: ApplicationProcessorRegister | undefined,\n): boolean {\n return register !== undefined && register.processors.length === 0;\n}\n\n/**\n * The entries that JOIN to a configured provider — the only arm either gap function can reason about.\n *\n * Both functions compare the register against the application's configured provider set, and an\n * AUTHORED entry is by construction not in that set: nothing configures the operator's hosting\n * company. Before the register grew its second arm they iterated every entry and read `providerRef`\n * off it, which the compiler now refuses — and rightly, because the answer would have been wrong in\n * both directions at once. Every authored entry would have been reported as \"naming a provider the\n * application does not configure\", and the real gap list would have been drowned in false ones.\n *\n * Extracted rather than inlined twice so the two functions cannot drift about what they are\n * comparing.\n */\nfunction configuredProviderEntries(\n register: ApplicationProcessorRegister | undefined,\n): ReadonlyArray<Extract<ApplicationProcessorDeclaration, { kind: ProcessorRegisterEntryKind.CONFIGURED_PROVIDER }>> {\n return (register?.processors ?? []).filter(\n (processor): processor is Extract<ApplicationProcessorDeclaration, { kind: ProcessorRegisterEntryKind.CONFIGURED_PROVIDER }> =>\n processor.kind === ProcessorRegisterEntryKind.CONFIGURED_PROVIDER,\n );\n}\n\n/**\n * Configured providers the register does not account for — the gap, per provider.\n *\n * Takes the configured set as an argument rather than reading it, so the same function serves the\n * companion (which reads the live composition) and a test (which supplies one). Order follows the\n * CONFIGURED list, so the answer is stable and reads like the composition it is about.\n */\nexport function undeclaredProcessorRefs(\n configuredProviderRefs: readonly string[],\n register: ApplicationProcessorRegister | undefined,\n): readonly string[] {\n const declared = new Set(configuredProviderEntries(register).map((processor) => processor.providerRef));\n return configuredProviderRefs.filter((providerRef) => !declared.has(providerRef));\n}\n\n/**\n * Declared processors naming a provider the application does not configure.\n *\n * The opposite error, and it is quieter: an entry left behind after a vendor was dropped keeps a\n * recipient in the notice that receives nothing. Reported rather than refused — a register is edited\n * by hand, and a stale entry is a thing to notice, not a reason to reject the file.\n */\nexport function processorRefsNotConfigured(\n configuredProviderRefs: readonly string[],\n register: ApplicationProcessorRegister | undefined,\n): readonly string[] {\n const configured = new Set(configuredProviderRefs);\n return configuredProviderEntries(register)\n .map((processor) => processor.providerRef)\n .filter((providerRef) => !configured.has(providerRef));\n}\n\n/*\n * WHICH configured providers are recipients, and which of those the register has not established, is no longer\n * answered here. `classifyConfiguredProviderRecipients` took the population as a list of refs, and its three\n * readers each built that list differently — capability-bearing providers only in the evidence collector, top-level\n * runtime scopes only in the brief and the computed facts, systems of record in none (#1707). The population and\n * its join to this register are now ONE function pair in `recipient-population.schemas.ts`:\n * `computeRecipientPopulation` and `joinRecipientPopulationToRegister`.\n */\n\n/**\n * Whether a dated compliance fact is still inside the interval the application declared (#1708).\n */\nexport enum ComplianceFactCurrency {\n /** Checked within the declared interval. */\n CURRENT = \"CURRENT\",\n /** Checked longer ago than the declared interval: re-check it against the vendor's page. */\n STALE = \"STALE\",\n /** Carries no date at all, so its age cannot be known. */\n UNDATED = \"UNDATED\",\n /** Dated, but the application declares no interval, so nothing says how old is too old. */\n NO_INTERVAL_DECLARED = \"NO_INTERVAL_DECLARED\",\n}\n\n/** One dated fact's currency. */\nexport interface ComplianceFactAge {\n readonly verifiedAt: string | null;\n readonly ageDays: number | null;\n readonly currency: ComplianceFactCurrency;\n}\n\n/** The staleness report: the register's own date, and every established vendor profile a reader relies on. */\nexport interface ComplianceFactStalenessReport {\n readonly asOf: string;\n readonly reverificationIntervalDays: number | null;\n readonly register: ComplianceFactAge;\n /** Per provider ref with an ESTABLISHED profile, dated by its OLDEST evidence. Sorted by ref. */\n readonly providerProfiles: readonly ({ readonly providerRef: string } & ComplianceFactAge)[];\n /** True when the register's own verification is {@link ComplianceFactCurrency.STALE}. */\n readonly registerStale: boolean;\n /** The provider refs whose profile is {@link ComplianceFactCurrency.STALE}. */\n readonly staleProviderRefs: readonly string[];\n /** The provider refs whose ESTABLISHED profile cites no evidence at all, so its age cannot be known. */\n readonly undatedProviderRefs: readonly string[];\n}\n\nconst MILLISECONDS_PER_DAY = 86_400_000;\n\nfunction ageOf(verifiedAt: string | null, asOf: string, intervalDays: number | null): ComplianceFactAge {\n if (verifiedAt === null) return { verifiedAt, ageDays: null, currency: ComplianceFactCurrency.UNDATED };\n const ageDays = Math.floor((Date.parse(`${asOf}T00:00:00Z`) - Date.parse(`${verifiedAt}T00:00:00Z`)) / MILLISECONDS_PER_DAY);\n if (intervalDays === null) return { verifiedAt, ageDays, currency: ComplianceFactCurrency.NO_INTERVAL_DECLARED };\n return { verifiedAt, ageDays, currency: ageDays > intervalDays ? ComplianceFactCurrency.STALE : ComplianceFactCurrency.CURRENT };\n}\n\n/**\n * Which compliance facts have outlived the interval the application declared (#1708) — DERIVED, never asked.\n *\n * Two populations, one interval: the operator's own register (its `verification.verifiedAt`) and the vendor facts\n * the framework suggests (each established profile's oldest `evidence[].verifiedAt`). The interval is the register's\n * `reverificationIntervalDays`, because how old is too old is the operator's policy for both; with none declared,\n * ages are still reported and nothing is called stale.\n *\n * `asOf` is a `YYYY-MM-DD` day supplied by the caller (the run's own instant), so the report is a pure function of\n * its inputs and a test can pin it. A report, never a refusal (`application-creation-directive.md`).\n *\n * assurance-control: WILDO.PRIVACY.THIRD_PARTY_PROCESSING — processor facts older than the operator's own\n * re-verification interval are named, so a notice does not keep stating a vendor arrangement nobody re-checked.\n */\nexport function complianceFactStaleness(params: {\n readonly register: ApplicationProcessorRegister | undefined;\n readonly profilesByProviderRef: Readonly<Record<string, ProviderComplianceProfile>>;\n /** The provider refs a reader relies on — the population's members. Profiles of other refs are not reported. */\n readonly providerRefs: readonly string[];\n readonly asOf: string;\n}): ComplianceFactStalenessReport {\n const intervalDays = params.register?.verification?.reverificationIntervalDays ?? null;\n const register = ageOf(params.register?.verification?.verifiedAt ?? null, params.asOf, intervalDays);\n const providerProfiles = [...new Set(params.providerRefs)].sort().flatMap((providerRef) => {\n const established = establishedProviderComplianceProfile(params.profilesByProviderRef[providerRef]);\n return established === null ? [] : [{ providerRef, ...ageOf(oldestProviderComplianceEvidenceDate(established), params.asOf, intervalDays) }];\n });\n return {\n asOf: params.asOf,\n reverificationIntervalDays: intervalDays,\n register,\n providerProfiles,\n registerStale: register.currency === ComplianceFactCurrency.STALE,\n staleProviderRefs: providerProfiles.filter((entry) => entry.currency === ComplianceFactCurrency.STALE).map((entry) => entry.providerRef),\n undatedProviderRefs: providerProfiles.filter((entry) => entry.currency === ComplianceFactCurrency.UNDATED).map((entry) => entry.providerRef),\n };\n}\n\n/** One register entry's contractual standing: its DPA and its recorded retention, as the operator stated them. */\nexport interface ProcessorAgreementStandingEntry {\n /** `providerRef` for a configured provider, `subprocessorRef` for an authored entry. */\n readonly ref: string;\n readonly entryKind: ProcessorRegisterEntryKind;\n /** `null` when the operator has not recorded a DPA — outstanding, never \"not required\". */\n readonly dataProcessingAgreement: DataProcessingAgreementStatus | null;\n readonly vendorRetention: string | null;\n}\n\n/** Which processors are governed by a recorded agreement, and which are not (#1709). */\nexport interface ProcessorAgreementStandingReport {\n /** Every register entry, sorted by ref. */\n readonly entries: readonly ProcessorAgreementStandingEntry[];\n /** Entries with NO DPA recorded — the question is open. */\n readonly agreementUnrecordedRefs: readonly string[];\n /** Entries the operator states have NO DPA in place — an Art. 28(3) gap, stated as such. */\n readonly agreementNotInPlaceRefs: readonly string[];\n /** Entries with no vendor retention recorded. */\n readonly vendorRetentionUnrecordedRefs: readonly string[];\n}\n\n/**\n * The register's contractual standing — which processors a recorded DPA governs, which the operator says none does,\n * and which nobody has recorded (#1709).\n *\n * Only the operator can know whether it is bound by a DPA, so this READS what the register states and names what it\n * does not; it never infers a status from a vendor offering one. An absent register yields an empty report — the\n * missing register is already named by the population join, and saying it twice would read as two findings.\n *\n * A report, never a refusal (`application-creation-directive.md`): a processing activity with no DPA is the\n * operator's gap to close, and naming it is what lets them.\n *\n * spec-cite: GDPR Art. 28(3), https://gdpr-info.eu/art-28-gdpr/ — \"Processing by a processor shall be governed by a\n * contract or other legal act under Union or Member State law, that is binding on the processor with regard to the\n * controller\".\n *\n * assurance-control: WILDO.PRIVACY.THIRD_PARTY_PROCESSING — a processor with no recorded or no in-place DPA is named,\n * so an unrecorded contractual basis does not read as a governed one.\n */\nexport function processorAgreementStanding(register: ApplicationProcessorRegister | undefined): ProcessorAgreementStandingReport {\n const entries = (register?.processors ?? [])\n .map((processor): ProcessorAgreementStandingEntry => ({\n ref: processor.kind === ProcessorRegisterEntryKind.CONFIGURED_PROVIDER ? processor.providerRef : processor.subprocessorRef,\n entryKind: processor.kind,\n dataProcessingAgreement: processor.dataProcessingAgreement?.status ?? null,\n vendorRetention: processor.vendorRetention ?? null,\n }))\n .sort((left, right) => left.ref.localeCompare(right.ref));\n return {\n entries,\n agreementUnrecordedRefs: entries.filter((entry) => entry.dataProcessingAgreement === null).map((entry) => entry.ref),\n agreementNotInPlaceRefs: entries.filter((entry) => entry.dataProcessingAgreement === DataProcessingAgreementStatus.NOT_IN_PLACE).map((entry) => entry.ref),\n vendorRetentionUnrecordedRefs: entries.filter((entry) => entry.vendorRetention === null).map((entry) => entry.ref),\n };\n}\n"]}
|
package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-access-grants.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/auth/resources/application-access-grants.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAUH,OAAO,EAEL,kCAAkC,EAClC,qBAAqB,IAAI,EAAE,EAC3B,yBAAyB,EAG1B,MAAM,uBAAuB,CAAC;AAuC/B;;;;;GAKG;AACH,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"application-access-grants.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/auth/resources/application-access-grants.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAUH,OAAO,EAEL,kCAAkC,EAClC,qBAAqB,IAAI,EAAE,EAC3B,yBAAyB,EAG1B,MAAM,uBAAuB,CAAC;AAuC/B;;;;;GAKG;AACH,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;iCAyYxD,CAAC"}
|
|
@@ -301,7 +301,8 @@ export const applicationAccessGrantsResourceSpecification = resourceSpecificatio
|
|
|
301
301
|
errorScenarios: [
|
|
302
302
|
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },
|
|
303
303
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },
|
|
304
|
-
{ code: HttpResponseStatusCode.
|
|
304
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller IS the requester — a request cannot be approved by the person who raised it.' },
|
|
305
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The request is no longer `pending_approval`.' },
|
|
305
306
|
],
|
|
306
307
|
idempotent: false,
|
|
307
308
|
examples: [{
|
package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-access-grants.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/auth/resources/application-access-grants.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,8CAA8C,IAAI,uCAAuC,EAAE,MAAM,8BAA8B,CAAC;AACzI,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,qBAAqB,IAAI,EAAE,EAC3B,yBAAyB,EACzB,oBAAoB,EACpB,kEAAkE,GACnE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,8CAA8C,EAAE,MAAM,6BAA6B,CAAC;AAC3K,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,mCAAmC,GAAG,qDAAqD,CAAC;AAClG,MAAM,kCAAkC,GAAG,qDAAqD,CAAC;AACjG,MAAM,mCAAmC,GAAG,iCAAiC,CAAC;AAC9E,MAAM,uCAAuC,GAAG,iCAAiC,CAAC;AAClF,MAAM,yCAAyC,GAAG,gCAAgC,CAAC;AAEnF,MAAM,oCAAoC,GAAG;IAC3C,GAAG,EAAE,mCAAmC;IACxC,aAAa,EAAE,yCAAyC;IACxD,cAAc,EAAE,mCAAmC;IACnD,aAAa,EAAE,kIAAkI;IACjJ,MAAM,EAAE,yBAAyB,CAAC,gBAAgB;IAClD,SAAS,EAAE,0BAA0B;IACrC,SAAS,EAAE,0BAA0B;IACrC,SAAS,EAAE,0BAA0B;CACtC,CAAC;AAEF,MAAM,mCAAmC,GAAG;IAC1C,GAAG,oCAAoC;IACvC,GAAG,EAAE,kCAAkC;IACvC,MAAM,EAAE,yBAA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EAAE,8CAA8C,EAAE;iBACnE;aACF;YACD,QAAQ,EAAE;gBACR,OAAO,EAAE,4PAA4P;gBACrQ,SAAS,EAAE,gFAAgF;gBAC3F,SAAS,EAAE;oBACT,KAAK,EAAE,EAAE,OAAO,EAAE,4BAA4B,EAAE;iBACjD;aACF;YACD,MAAM,EAAE;gBACN,OAAO,EAAE,oFAAoF;gBAC7F,SAAS,EAAE,sFAAsF;gBACjG,SAAS,EAAE;oBACT,KAAK,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE;iBAChD;aACF;SACF;KACF;IACD,KAAK,EAAE;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,iMAAiM,EAAE,SAAS,EAAE,4EAA4E,EAAE;QAClT,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,0EAA0E,EAAE,SAAS,EAAE,4CAA4C,EAAE;QAC3J,CAAC,kCAAkC,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,4DAA4D,EAAE,SAAS,EAAE,4EAA4E,EAAE;QACvN,CAAC,kCAAkC,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,8CAA8C,EAAE,SAAS,EAAE,sEAAsE,EAAE;QAC5L,CAAC,kCAAkC,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2CAA2C,EAAE,SAAS,EAAE,kCAAkC,EAAE;QAClJ,CAAC,kCAAkC,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,SAAS,EAAE,8DAA8D,EAAE;QAC/K,CAAC,kCAAkC,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,mHAAmH,EAAE,SAAS,EAAE,kDAAkD,EAAE;KAC7O;CACF,CAAC,CACH,CAAC","sourcesContent":["/**\n * Resource: `applicationAccessGrants` — Wildo SaaS engine specification (backend-only, application-scoped).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/security/authorizations/application-access-grants.shared.schemas.ts\n * → `ApplicationAccessGrantSchema`\n * - Factory: engine/saas-models/src/security/authorizations/application-access-grants.shared.resources-config.schemas.ts\n * → `applicationAccessGrantsResourceConfiguration_InitializationFactory`\n * - Custom operations: `ApplicationAccessGrants_Operations`\n *\n * ## Why this exists BESIDE `platformAccessGrants` rather than inside it\n *\n * The tenant grant governs an operator reaching into ONE named organization, and the organization\n * approves. That is the industry ceiling (Microsoft Customer Lockbox, Google Access Approval) and it\n * works. It cannot govern a read that names NO tenant — an enumeration of the whole user directory,\n * or of the cross-tenant audit trail when independent approval is configured — because there is no single customer to ask and no tenant for\n * the route to carry.\n *\n * Measured 2026-09-09: the NARROW act required a requested, justified, time-bound, tenant-approved\n * grant, while the WIDEST read required an administrator role and nothing else, at a strictly LOWER\n * role tier. This resource is the answer, and its one new idea is the TWO-PERSON RULE: the approval\n * comes from a second platform administrator, never the requester.\n *\n * Why backend-only: there is NO entry for `[CoreResourceType.APPLICATION_ACCESS_GRANTS]` in any\n * preset under engine/presets-components/src/config/resources/. The operator-facing queue is not\n * built yet; today the resource is consumed by the authorizer's admission predicate and by the\n * platform API.\n *\n * Why `APPLICATION` scope: the elevation belongs to the deployment, not to any tenant inside it. The\n * scope is expressed once, in the registry relationship APPLICATION → APPLICATION_ACCESS_GRANTS\n * carrying `isPrimaryScope: true`; the runtime config deliberately does not restate it.\n */\n\nimport { applicationAccessGrantsAdminResourceUIBehavior as applicationAccessGrantsUIBehaviorSource } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n ApplicationAccessGrantSchema,\n ApplicationAccessGrants_Operations,\n CoreResourceOperation as Op,\n PlatformAccessGrantStatus,\n ResourcePrimaryScope,\n applicationAccessGrantsResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst APPLICATION_ACCESS_PENDING_GRANT_ID = 'application_access_grant_01J5Q2A3B4C5D6E7F8G9H0J1KL';\nconst APPLICATION_ACCESS_ACTIVE_GRANT_ID = 'application_access_grant_01J5Q2C4D5E6F7G8H9J0K1L2MN';\nconst APPLICATION_ACCESS_OPERATOR_USER_ID = 'user_01J5Q2E5F6G7H8J9K0L1M2N3PQ';\nconst APPLICATION_ACCESS_SECOND_ADMIN_USER_ID = 'user_01J5Q2G6H7J8K9L0M1N2P3Q4RS';\nconst APPLICATION_ACCESS_EXAMPLE_APPLICATION_ID = 'app_01J5Q2J7K8L9M0N1P2Q3R4S5TU';\n\nconst applicationAccessPendingGrantExample = {\n _id: APPLICATION_ACCESS_PENDING_GRANT_ID,\n applicationId: APPLICATION_ACCESS_EXAMPLE_APPLICATION_ID,\n operatorUserId: APPLICATION_ACCESS_OPERATOR_USER_ID,\n justification: 'Incident INC-5107 spans several tenants; I need the audit view, configured for independent approval, to find which are affected.',\n status: PlatformAccessGrantStatus.PENDING_APPROVAL,\n expiresAt: '2026-09-09T13:30:00.000Z',\n createdAt: '2026-09-09T13:00:00.000Z',\n updatedAt: '2026-09-09T13:00:00.000Z',\n};\n\nconst applicationAccessActiveGrantExample = {\n ...applicationAccessPendingGrantExample,\n _id: APPLICATION_ACCESS_ACTIVE_GRANT_ID,\n status: PlatformAccessGrantStatus.ACTIVE,\n approvedByUserId: APPLICATION_ACCESS_SECOND_ADMIN_USER_ID,\n approvedAt: '2026-09-09T13:04:00.000Z',\n decidedByUserId: APPLICATION_ACCESS_SECOND_ADMIN_USER_ID,\n decidedAt: '2026-09-09T13:04:00.000Z',\n updatedAt: '2026-09-09T13:04:00.000Z',\n};\n\ntype Cfg = ReturnType<typeof applicationAccessGrantsResourceConfiguration_InitializationFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst applicationAccessGrantsUIBehavior = applicationAccessGrantsUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\n/**\n * Carries a frontend overlay since 2026-09-17. The mechanism shipped with no surface at all, which\n * is the worst possible shape for a two-person rule: its whole justification is that the\n * consequence becomes VISIBLE rather than prevented, and an elevation nobody can read makes nothing\n * visible. The narration below describes the review queue an administrator now actually reaches.\n */\nexport const applicationAccessGrantsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(applicationAccessGrantsUIBehavior),\n resourceSpecification(\n applicationAccessGrantsResourceConfiguration_InitializationFactory,\n ApplicationAccessGrantSchema,\n ({ schemaShape }) => ({\n purpose: 'Give a platform support team a justified, short-lived, second-signed way to perform application-wide reads that require elevation (the user directory and other enrolled surfaces, plus the audit viewer when its independent-approval policy is enabled), or, under its own purpose, a window in which the doors declared to overrule an organization may act on one named organization, such as releasing a vendor account it holds.',\n businessRole: 'The deployment\\'s application-wide access ledger. It answers who asked to see across every tenant, why, which SECOND administrator agreed, how long the window lasted, and how it ended.',\n lifecycleRole: 'A platform administrator requests, stating a reason. The request is never usable on creation. A DIFFERENT platform administrator approves or denies it; the requester may withdraw or refuse their own request but can never approve it. Either can revoke an active window early, and expiry ends it automatically. Completed requests remain available as access-review history.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.AUTH,\n\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ApplicationAccessGrantSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'applicationAccessGrantsResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'APPLICATION_ACCESS_GRANTS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ApplicationAccessGrants_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'The `status` vocabulary is SHARED with `platformAccessGrants` (`PlatformAccessGrantStatus`) rather than duplicated. The states really are the same states, and two enums holding the same five members is how a sweep, an admission predicate and a UI come to disagree about what `active` means.',\n 'There is no auto-approval and therefore no `autoApprovalReason` field. The tenant grant auto-approves when the tenant has not opted into approval or cannot approve — both statements about a NAMED tenant, and this row names none. A grant that could approve itself would make the two-person rule ceremonial.',\n 'No public CREATE or UPDATE. `requestAccess` is the only writer of a new row, and `approve` / `deny` / `revoke` / `expire` are the only status transitions. A generic CREATE would let a caller author their own `status` and mint an ACTIVE application-wide elevation with no second signature at all.',\n 'No DELETE, and one route-less DELETE_MANY. Nothing but the retention-class sweep removes a row: this is a REFERENCE child of the APPLICATION row that outlives it on purpose (#3355: deleting the application must not shorten the period its access evidence is kept for), and with no period the rows would outlive every statement the application makes about its access evidence. Bound to `AUDIT_LOGS` from creation. INTERNAL_CALL registers no route, so no caller can erase a grant from the record.',\n 'The lifecycle audit event is shared too: `CoreAuditableEventType.PLATFORM_ACCESS_GRANT_LIFECYCLE`, carrying `grantScope: application_wide` and no `targetOrganizationId`. One event so a reviewer asking \"what elevated access was granted, to whom, by whom?\" gets one query rather than a union of two they have to remember.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Identifier for one application-wide elevation request.',\n whyItMatters: 'The address of every subsequent decision, and the value the audit trail carries as `authorizingGrantId` when a read is admitted under it — which is what joins an operator\\'s reads to the two administrators who signed for them.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n applicationId: schemaShape.applicationId.foreignKeySpec({\n meaning: 'The deployment this elevation is inside.',\n whyItMatters: 'Every row carries it, although the schema marks it optional: the application is part of the request path, so it is always known.',\n importance: FieldSemanticImportance.CONTEXTUAL,\n }),\n operatorUserId: schemaShape.operatorUserId.foreignKeySpec({\n meaning: 'The platform administrator who requested the elevation.',\n whyItMatters: 'Server-authored from the session, never client-supplied, and it is the field the two-person rule measures against: `approve` refuses when the approver equals this value. An elevation whose subject the caller could choose would let one administrator mint application-wide access under another\\'s name and then sign it themselves.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n justification: schemaShape.justification.stringSpec({\n meaning: 'Why the operator needs to see across every tenant, in their own words.',\n whyItMatters: 'Required, and it carries more weight here than on the tenant grant: it is the ONLY thing the approving administrator has to decide on. A tenant grant\\'s approver knows their own tenant and their own support case; this approver knows nothing but this sentence. A second signature on an unstated reason is a countersignature on nothing.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Where this elevation is in its lifecycle.',\n whyItMatters: 'Read together with `expiresAt`, never alone: the admission predicate accepts ACTIVE and then re-checks the window, so a grant whose window elapsed stops working whether or not anything has relabelled it. Every row starts PENDING_APPROVAL — there is no branch that reaches ACTIVE without a second administrator acting.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'PlatformAccessGrantStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n }),\n expiresAt: schemaShape.expiresAt.dateSpec({\n meaning: 'When the elevation stops working.',\n whyItMatters: 'The control, not the label. Server-authored from the requested duration and clamped to ONE HOUR — a quarter of the tenant grant\\'s ceiling, because this elevation reaches every customer at once and no customer can see or revoke it, so the clock is the only thing that ends it on its own.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n approvedByUserId: schemaShape.approvedByUserId.foreignKeySpec({\n meaning: 'The SECOND administrator who signed.',\n whyItMatters: 'The whole feature, as a field. It is optional in the schema because it is unset while pending and stays unset on a denied or revoked grant — never because an ACTIVE grant might lack one. The only writer of ACTIVE is `approve`, and `approve` refuses when this would equal `operatorUserId`.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n approvedAt: schemaShape.approvedAt.dateSpec({\n meaning: 'When the second administrator approved the elevation. Absent while it is pending and on a denied request.',\n temporalRole: 'occurred',\n }),\n decidedByUserId: schemaShape.decidedByUserId.foreignKeySpec({\n meaning: 'The administrator who made the last decision on the grant: approved, denied or revoked it.',\n whyItMatters: 'Answers who refused a request or ended a window early, which the approver field cannot, and keeps the last decision\\'s reason attached to the person who gave it. Written by `approve`, `deny` and `revoke`; expiry is not a decision and leaves it alone.',\n }),\n operatorName: schemaShape.operatorName.stringSpec({ meaning: 'The operator who requested the elevation, by name: `operatorUserId`\\'s label fallback. Resolved at read time from the person\\'s profile, else their account\\'s email (`forwardedUserName`, opted in for the operator only); never stored, so the row keeps only the id (#1852).', whyItMatters: 'A tenant administrator approving an operator usually may not read the operator\\'s account, so the reference alone could not say who is asking. Hidden from display: the person is shown through the foreign key, and this name is its label when the viewer may not read the user.' }),\n approvedByName: schemaShape.approvedByName.stringSpec({ meaning: 'The administrator who approved, by name: `approvedByUserId`\\'s label fallback. Resolved at read time from the person\\'s profile, and absent when they have none (`forwardedUserName`; never their email); never stored, so the row keeps only the id (#1852).', whyItMatters: 'Hidden from display: the person is shown through the foreign key, and this name is its label when the viewer may not read the user.' }),\n decidedByName: schemaShape.decidedByName.stringSpec({ meaning: 'The administrator who made the last decision, by name: `decidedByUserId`\\'s label fallback. Resolved at read time from the person\\'s profile, and absent when they have none (`forwardedUserName`; never their email); never stored, so the row keeps only the id (#1852).', whyItMatters: 'Hidden from display: the person is shown through the foreign key, and this name is its label when the viewer may not read the user.' }),\n decidedAt: schemaShape.decidedAt.dateSpec({\n meaning: 'When the last decision was made.',\n whyItMatters: 'Places a refusal or an early revocation in time against the access it ended.',\n temporalRole: 'occurred',\n }),\n purpose: schemaShape.purpose.enumSpec({\n meaning: 'What the elevation admits, and so what the second administrator signs for: tenant-spanning reads, or a window onto the doors declared to overrule an organization, on the organization in `targetOrganizationId`.',\n whyItMatters: 'The two acts are not one act. A read changes nothing and names no tenant; an overrule changes one organization\\'s rows against its will. A window approved for one never admits the other, so an approver who signed for reading the directory has not signed for releasing a tenant\\'s vendor account. Set at request time and never updated. A request that states none asks for reads.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ApplicationAccessGrantPurpose',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n }),\n targetOrganizationId: schemaShape.targetOrganizationId.stringSpec({\n meaning: 'The one organization a `tenant_overrule` elevation may act on. Absent on every other purpose.',\n whyItMatters: 'Names the tenant the second administrator agreed to overrule, so the window cannot be spent on another. Re-read at request time (an organization that does not exist is refused) and compared with the organization of the row the act would change.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n targetOrganizationName: schemaShape.targetOrganizationName.stringSpec({\n meaning: 'What the target organization was called when the overrule was requested. Absent on every other purpose.',\n whyItMatters: 'What the approver reads to know whom they are signing against. A snapshot, not a lookup: the approver holds no grant into that tenant, so resolving the id would be a crossing of its own. Written from the organization the request re-read; the id stays the authority the admission compares.',\n semanticRole: 'label',\n }),\n grantedMachineCredential: schemaShape.grantedMachineCredential.objectSpec({\n meaning: 'The one machine credential of this application — an API key or an OAuth client — the elevation is for, when it is for a machine rather than the requester.',\n whyItMatters: 'Under independent audit-read approval a machine could otherwise never read, since a grant was keyed on a user and a machine has none — so an assurance collector, the reader that policy most wants governed, was shut out. When set, the grant admits exactly that credential and NEVER the administrator who requested it: naming a machine must not be a way to mint oneself a window. Validated against the live credential at request time and never updated, because re-pointing a signed grant at another credential would be a grant nobody signed. Like any read grant it satisfies EVERY read that requires one — not only the audit viewer — so what the credential can actually read is still bounded by the roles it holds: give it the read-only audit-evidence reader role, which reaches the audit viewer and nothing else. A machine is never granted an overrule: that is a person\\'s decision.',\n importance: FieldSemanticImportance.CONTEXTUAL,\n }),\n decisionReason: schemaShape.decisionReason.stringSpec({\n meaning: 'The reason given with the LAST decision — an approval, a refusal or a revocation — belonging to `decidedByUserId`. A decision given without one clears it.',\n whyItMatters: 'What a later reader needs to tell a refusal that was considered from one that was reflexive. Scrubbed on subject erasure, like the justification, because it is free text one administrator wrote about another\\'s request.',\n importance: FieldSemanticImportance.CONTEXTUAL,\n }),\n },\n\n operations: {\n [Op.READ]: {\n purpose: 'Read one application-wide elevation request.',\n outcome: 'The request\\'s current state, including who asked, who signed and when the window closes.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The elevation request is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator. There is no tenant-side reader here — an application-wide elevation has no customer to show it to, which is exactly why its approval had to become a second signature.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Read a pending request',\n request: { applicationAccessGrantId: APPLICATION_ACCESS_PENDING_GRANT_ID },\n response: applicationAccessPendingGrantExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.LIST]: {\n purpose: 'List elevation requests — the pending queue a second administrator works from, and the history a reviewer reads.',\n outcome: 'A page of elevation requests.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A page of elevation requests is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Work the pending queue',\n request: { page: 1, limit: 20, sort: 'createdAt:desc' },\n // The framework's page envelope: the counts sit under `pagination` (#1838: they were at the top level).\n response: { data: [applicationAccessPendingGrantExample], pagination: { page: 1, limit: 20, total: 1, totalPages: 1 } },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.COUNT]: {\n purpose: 'Count elevation requests matching a filter.',\n outcome: 'A number — how many requests are pending a signature, or how many were granted in a period.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The count is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n ],\n idempotent: true,\n examples: [{\n title: 'How many requests are awaiting a second signature',\n request: { status: PlatformAccessGrantStatus.PENDING_APPROVAL },\n response: { count: 1 },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [ApplicationAccessGrants_Operations.REQUEST_ACCESS]: {\n operationId: ApplicationAccessGrants_Operations.REQUEST_ACCESS,\n purpose: 'Ask for a short, justified window in which the tenant-spanning reads become available, or in which the doors declared to overrule an organization may act on one named organization.',\n outcome: 'A request in `pending_approval`, usable by nobody until a DIFFERENT platform administrator approves it. The window is recorded at creation and starts running then, so a request nobody signs simply lapses.',\n whenToUse: 'An operator needs an elevation-gated read that names no single tenant (the user directory, or the audit viewer with independent approval enabled, for a support case or incident spanning customers), or must overrule one organization through a door that declares it, such as releasing a vendor account the organization holds (`purpose: tenant_overrule`, `targetOrganizationId`).',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The elevation request was recorded and awaits a second administrator.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The justification is missing or empty. It is required because it is the only thing the approver has to decide on.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`grantedMachineCredential` names no active, unexpired API key or OAuth client of this application. The refusal does not say which condition failed.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The purpose and the target do not fit: a `tenant_overrule` that names no organization, names one that does not exist, or binds a machine credential; or a read that names an organization.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Ask to see across tenants for a multi-customer incident',\n request: {\n justification: 'Incident INC-5107 spans several tenants; I need the audit view, configured for independent approval, to find which are affected.',\n requestedDurationMinutes: 30,\n },\n response: applicationAccessPendingGrantExample,\n forStatus: HttpResponseStatusCode.CREATED_201,\n }],\n },\n [ApplicationAccessGrants_Operations.APPROVE]: {\n operationId: ApplicationAccessGrants_Operations.APPROVE,\n purpose: 'Sign another administrator\\'s request — the second signature.',\n outcome: 'The request becomes `active` and names the approver. Until the window closes what its purpose names becomes available to exactly one principal: the tenant-spanning reads, or the one overrule of the named organization, to the REQUESTER — or, for a read grant bound to a machine credential, to that credential and not the requester.',\n whenToUse: 'A platform administrator has read the requester\\'s justification and purpose (and, for an overrule, the organization it names) and agrees that act is warranted.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The elevation is now active, and its updated state — including the approver — is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The caller IS the requester — a request cannot be approved by the person who raised it — or the request is no longer `pending_approval`.' },\n ],\n idempotent: false,\n examples: [{\n title: 'A second administrator signs',\n request: {\n applicationAccessGrantId: APPLICATION_ACCESS_PENDING_GRANT_ID,\n decisionReason: 'Reviewed against INC-5107; scope and window are proportionate.',\n },\n response: applicationAccessActiveGrantExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [ApplicationAccessGrants_Operations.DENY]: {\n operationId: ApplicationAccessGrants_Operations.DENY,\n purpose: 'Refuse a pending request.',\n outcome: 'The request becomes `denied` and cannot be retried; a later need requires a new request.',\n whenToUse: 'A platform administrator judges the reach unwarranted — or the requester themselves thinks better of it.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The request was denied, and its final state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The request is no longer `pending_approval`.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Withdraw your own request',\n request: {\n applicationAccessGrantId: APPLICATION_ACCESS_PENDING_GRANT_ID,\n decisionReason: 'The affected tenants were identified from the incident channel; the wide read is no longer needed.',\n },\n response: {\n ...applicationAccessPendingGrantExample,\n status: PlatformAccessGrantStatus.DENIED,\n decisionReason: 'The affected tenants were identified from the incident channel; the wide read is no longer needed.',\n updatedAt: '2026-09-09T13:06:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [ApplicationAccessGrants_Operations.REVOKE]: {\n operationId: ApplicationAccessGrants_Operations.REVOKE,\n purpose: 'End a pending or active elevation early.',\n outcome: 'The elevation becomes `revoked` and the tenant-spanning reads stop immediately instead of remaining available until the recorded expiry.',\n whenToUse: 'The support work finished before the window did, or a reviewer decides the reach should end now.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The elevation was revoked, and its final state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The elevation is already denied, revoked or expired. Only a `pending_approval` or `active` one can be revoked.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Close the window as soon as the incident is scoped',\n request: {\n applicationAccessGrantId: APPLICATION_ACCESS_ACTIVE_GRANT_ID,\n decisionReason: 'INC-5107 scoped to three tenants; per-tenant grants requested instead.',\n },\n response: {\n ...applicationAccessActiveGrantExample,\n status: PlatformAccessGrantStatus.REVOKED,\n decisionReason: 'INC-5107 scoped to three tenants; per-tenant grants requested instead.',\n updatedAt: '2026-09-09T13:18:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [ApplicationAccessGrants_Operations.EXPIRE]: {\n operationId: ApplicationAccessGrants_Operations.EXPIRE,\n purpose: 'Relabel an active elevation whose window has closed.',\n outcome: 'The elevation reads `expired` rather than `active` in the queue and the history.',\n whenToUse: 'Never by hand. The credential-expiry sweep dispatches it and nothing else does — there is no route and no affordance, because nobody needs a button that declares a date has passed.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The elevation was relabelled expired.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The elevation is not `active`. A denied or revoked one is terminal and must keep saying which — relabelling it would rewrite the decision history a reviewer reads.' },\n ],\n idempotent: false,\n examples: [{\n title: 'The sweep closes a lapsed window',\n request: {},\n response: {\n ...applicationAccessActiveGrantExample,\n status: PlatformAccessGrantStatus.EXPIRED,\n updatedAt: '2026-09-09T13:31:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n\n businessConstraints: [\n 'THE control: `approve` refuses when the approver is the requester. Enforced TWICE, and neither half alone is the control — the operation\\'s `enabledCondition` makes the affordance disappear so no console renders an Approve button on one\\'s own request, and the custom implementation makes the transition impossible so a future variant authored without that condition cannot transition silently. The comparison itself lives in ONE exported predicate, which fails CLOSED when either identity is missing: an approval reaching the check with no decider has no second person behind it, and the naive inline form would admit exactly that case.',\n 'Customer approval is the industry ceiling and is structurally unavailable here — there is no single customer to ask — so a second signature is the strongest control that exists for this act. That is why AUTO-APPROVAL was rejected even though it is the tenant grant\\'s own default posture: that default is defensible only because a tenant can opt in above it, and there is no such party here.',\n 'Application-wide directory and declared cross-tenant reads retain their elevation gate. The application audit viewer and the assurance evidence doors are the explicit policy exception: auditTrail.applicationReadAccess, when undeclared, follows the application\\'s shape in all environments (#2618): AuditApplicationReadAccess.INDEPENDENT_APPROVAL, which requires this grant, where the parties of some relationship kind are independent of the operator, and ROLE_BASED otherwise. Both modes keep administrator-role checks and crossing observations; role-based evidence carries no fabricated grant id. Grant requests themselves are never auto-approved.',\n 'The per-row tenant crossing is deliberately NOT gated on this grant. That door already works, approved by the customer it names; requiring an application-wide elevation there too would replace a customer-approvable control with a platform-internal one, which is a step DOWN the operator-access ladder.',\n 'Both grant resources are EXEMPT from the admission wholesale — this one and `platformAccessGrants`. An operator would otherwise need an application-wide grant in order to ask for one, and the second administrator would need one in order to read the queue and sign. The exemption is safe for the reason the tenant resource\\'s own bootstrap exemption is safe: these rows are the elevation ledger, they belong to no tenant, and reading them discloses no customer\\'s data.',\n 'Usability is EVALUATED, never read off `status`. A grant counts only when it is ACTIVE and `expiresAt` is still in the future, through the single predicate both grant resources share. The expiry sweep\\'s relabelling is bookkeeping for humans; if admission read the label, a lagging sweep would be an authorization hole rather than a stale display.',\n 'The window is SHORTER than a tenant elevation\\'s — 30 minutes by default against 60, one hour maximum against four — and the ORDER is the design rather than the numbers. A tenant elevation reaches one customer who can see and revoke it; this one reaches every customer and none of them can.',\n 'Terminal statuses are how an elevation ends. DENIED, EXPIRED and REVOKED are never edited back to life, and there is no delete verb of any kind: an elevation record either party could erase is not evidence.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n ),\n () => ({\n label: {\n purpose: 'The request\\'s justification, the one thing the approving administrator decides on. It is a summary field, so the list card carries it; naming a card by the request instant, when that was not a summary field, showed the raw id on every card (#2329). A row whose justification was masked on erasure is named by the instant it was made (a summary field since #3066, so the list carries it too), then by its id. The record carries the requesting operator only as a user id, and a synchronous label cannot resolve a name, so the operator is shown — resolved to the person — as the first row of the body and on the card instead.',\n },\n layout: {\n purpose: 'Three sections that separate the two identities the control exists to keep apart: `request` (who asked and why), `decision` (who signed and why), `window` (how long, and which credential it admits). Folding decision into request would put requester and approver in one block, which is precisely the distinction `applicationAccessGrantApproverIsDistinct` enforces.',\n displayPurpose: 'Read-only. Every state change goes through a named verb — request, approve, deny, revoke, expire — and none through a form, so there is deliberately no edit layout. The header carries the request instant and the status badge; the three titled cards follow, with no descriptions. Both identities resolve to the person. The decision reason and the machine credential hide when empty; the approver row stays, because on a pending request its emptiness is the answer.',\n summaryPurpose: 'A card titled with the record\\'s name (its justification, else the request instant, else its id), then who asked, the status badge, and the expiry labelled.',\n sections: {\n request: {\n purpose: 'The requesting operator and the stated justification. Status and the instant are the page header.',\n whenToUse: 'The review queue, and the first block of any single-grant read.',\n textSlots: {\n title: { purpose: 'Label the request block: who asked, and why.' },\n },\n },\n decision: {\n purpose: 'The second administrator and when they signed, the administrator who made the LAST decision (approved, denied or revoked) and when, and that decision\\u2019s reason. A denial or a revocation is read against its own decider, never against the approver.',\n whenToUse: 'Auditing whether an elevation was independently approved, and on what grounds.',\n textSlots: {\n title: { purpose: 'Label the signature block.' },\n },\n },\n window: {\n purpose: 'Expiry, and the machine credential the grant admits when it was requested for one.',\n whenToUse: 'Judging live exposure, and confirming a grant admits the credential it was meant to.',\n textSlots: {\n title: { purpose: 'Label the validity block.' },\n },\n },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'The review queue, reached from Settings → Administration → Access grants. A `status` quick-filter over `createdAt` day buckets, because an unsigned request is the only row that needs anybody.', whenToUse: 'Signing off pending elevations, and reviewing what has been held recently.' },\n [Op.READ]: { purpose: 'One elevation in full, including both identities and the stated reasons.', whenToUse: 'Auditing a specific window after the fact.' },\n [ApplicationAccessGrants_Operations.REQUEST_ACCESS]: { purpose: 'The bootstrap verb. Writes PENDING_APPROVAL, never ACTIVE.', whenToUse: 'An operator needs an application-wide read and does not yet hold a window.' },\n [ApplicationAccessGrants_Operations.APPROVE]: { purpose: 'The second signature; refuses the requester.', whenToUse: 'A different administrator has read the justification and accepts it.' },\n [ApplicationAccessGrants_Operations.DENY]: { purpose: 'Terminal refusal, with a recorded reason.', whenToUse: 'The justification does not hold.' },\n [ApplicationAccessGrants_Operations.REVOKE]: { purpose: 'Ends an ACTIVE window before its expiry.', whenToUse: 'Circumstances changed, or the elevation is no longer needed.' },\n [ApplicationAccessGrants_Operations.EXPIRE]: { purpose: 'ACTIVE → EXPIRED, dispatched by the credential-expiry sweep and by nothing else. Headless — no person invokes it.', whenToUse: 'Never by hand; use REVOKE to end a window early.' },\n },\n }),\n);\n"]}
|
|
1
|
+
{"version":3,"file":"application-access-grants.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/auth/resources/application-access-grants.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,8CAA8C,IAAI,uCAAuC,EAAE,MAAM,8BAA8B,CAAC;AACzI,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,qBAAqB,IAAI,EAAE,EAC3B,yBAAyB,EACzB,oBAAoB,EACpB,kEAAkE,GACnE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,8CAA8C,EAAE,MAAM,6BAA6B,CAAC;AAC3K,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,mCAAmC,GAAG,qDAAqD,CAAC;AAClG,MAAM,kCAAkC,GAAG,qDAAqD,CAAC;AACjG,MAAM,mCAAmC,GAAG,iCAAiC,CAAC;AAC9E,MAAM,uCAAuC,GAAG,iCAAiC,CAAC;AAClF,MAAM,yCAAyC,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AAsE,EAAE;QAC5L,CAAC,kCAAkC,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,2CAA2C,EAAE,SAAS,EAAE,kCAAkC,EAAE;QAClJ,CAAC,kCAAkC,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,SAAS,EAAE,8DAA8D,EAAE;QAC/K,CAAC,kCAAkC,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,mHAAmH,EAAE,SAAS,EAAE,kDAAkD,EAAE;KAC7O;CACF,CAAC,CACH,CAAC","sourcesContent":["/**\n * Resource: `applicationAccessGrants` — Wildo SaaS engine specification (backend-only, application-scoped).\n *\n * Inputs:\n * - Schema: engine/saas-models/src/security/authorizations/application-access-grants.shared.schemas.ts\n * → `ApplicationAccessGrantSchema`\n * - Factory: engine/saas-models/src/security/authorizations/application-access-grants.shared.resources-config.schemas.ts\n * → `applicationAccessGrantsResourceConfiguration_InitializationFactory`\n * - Custom operations: `ApplicationAccessGrants_Operations`\n *\n * ## Why this exists BESIDE `platformAccessGrants` rather than inside it\n *\n * The tenant grant governs an operator reaching into ONE named organization, and the organization\n * approves. That is the industry ceiling (Microsoft Customer Lockbox, Google Access Approval) and it\n * works. It cannot govern a read that names NO tenant — an enumeration of the whole user directory,\n * or of the cross-tenant audit trail when independent approval is configured — because there is no single customer to ask and no tenant for\n * the route to carry.\n *\n * Measured 2026-09-09: the NARROW act required a requested, justified, time-bound, tenant-approved\n * grant, while the WIDEST read required an administrator role and nothing else, at a strictly LOWER\n * role tier. This resource is the answer, and its one new idea is the TWO-PERSON RULE: the approval\n * comes from a second platform administrator, never the requester.\n *\n * Why backend-only: there is NO entry for `[CoreResourceType.APPLICATION_ACCESS_GRANTS]` in any\n * preset under engine/presets-components/src/config/resources/. The operator-facing queue is not\n * built yet; today the resource is consumed by the authorizer's admission predicate and by the\n * platform API.\n *\n * Why `APPLICATION` scope: the elevation belongs to the deployment, not to any tenant inside it. The\n * scope is expressed once, in the registry relationship APPLICATION → APPLICATION_ACCESS_GRANTS\n * carrying `isPrimaryScope: true`; the runtime config deliberately does not restate it.\n */\n\nimport { applicationAccessGrantsAdminResourceUIBehavior as applicationAccessGrantsUIBehaviorSource } from '@wildo-ai/presets-components';\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport type { ResourceUIBehaviorConfig } from '@wildo-ai/saas-frontend-lib/companion';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n ApplicationAccessGrantSchema,\n ApplicationAccessGrants_Operations,\n CoreResourceOperation as Op,\n PlatformAccessGrantStatus,\n ResourcePrimaryScope,\n applicationAccessGrantsResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst APPLICATION_ACCESS_PENDING_GRANT_ID = 'application_access_grant_01J5Q2A3B4C5D6E7F8G9H0J1KL';\nconst APPLICATION_ACCESS_ACTIVE_GRANT_ID = 'application_access_grant_01J5Q2C4D5E6F7G8H9J0K1L2MN';\nconst APPLICATION_ACCESS_OPERATOR_USER_ID = 'user_01J5Q2E5F6G7H8J9K0L1M2N3PQ';\nconst APPLICATION_ACCESS_SECOND_ADMIN_USER_ID = 'user_01J5Q2G6H7J8K9L0M1N2P3Q4RS';\nconst APPLICATION_ACCESS_EXAMPLE_APPLICATION_ID = 'app_01J5Q2J7K8L9M0N1P2Q3R4S5TU';\n\nconst applicationAccessPendingGrantExample = {\n _id: APPLICATION_ACCESS_PENDING_GRANT_ID,\n applicationId: APPLICATION_ACCESS_EXAMPLE_APPLICATION_ID,\n operatorUserId: APPLICATION_ACCESS_OPERATOR_USER_ID,\n justification: 'Incident INC-5107 spans several tenants; I need the audit view, configured for independent approval, to find which are affected.',\n status: PlatformAccessGrantStatus.PENDING_APPROVAL,\n expiresAt: '2026-09-09T13:30:00.000Z',\n createdAt: '2026-09-09T13:00:00.000Z',\n updatedAt: '2026-09-09T13:00:00.000Z',\n};\n\nconst applicationAccessActiveGrantExample = {\n ...applicationAccessPendingGrantExample,\n _id: APPLICATION_ACCESS_ACTIVE_GRANT_ID,\n status: PlatformAccessGrantStatus.ACTIVE,\n approvedByUserId: APPLICATION_ACCESS_SECOND_ADMIN_USER_ID,\n approvedAt: '2026-09-09T13:04:00.000Z',\n decidedByUserId: APPLICATION_ACCESS_SECOND_ADMIN_USER_ID,\n decidedAt: '2026-09-09T13:04:00.000Z',\n updatedAt: '2026-09-09T13:04:00.000Z',\n};\n\ntype Cfg = ReturnType<typeof applicationAccessGrantsResourceConfiguration_InitializationFactory>;\ntype Custom = NonNullable<Cfg['customOperation']>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = Cfg['mainSchema'];\n\nconst applicationAccessGrantsUIBehavior = applicationAccessGrantsUIBehaviorSource as ResourceUIBehaviorConfig<Custom, Core, Main>;\n\n/**\n * Carries a frontend overlay since 2026-09-17. The mechanism shipped with no surface at all, which\n * is the worst possible shape for a two-person rule: its whole justification is that the\n * consequence becomes VISIBLE rather than prevented, and an elevation nobody can read makes nothing\n * visible. The narration below describes the review queue an administrator now actually reaches.\n */\nexport const applicationAccessGrantsResourceSpecification = resourceSpecificationFromFrontendConfiguration(\n resourceFrontendConfiguration(applicationAccessGrantsUIBehavior),\n resourceSpecification(\n applicationAccessGrantsResourceConfiguration_InitializationFactory,\n ApplicationAccessGrantSchema,\n ({ schemaShape }) => ({\n purpose: 'Give a platform support team a justified, short-lived, second-signed way to perform application-wide reads that require elevation (the user directory and other enrolled surfaces, plus the audit viewer when its independent-approval policy is enabled), or, under its own purpose, a window in which the doors declared to overrule an organization may act on one named organization, such as releasing a vendor account it holds.',\n businessRole: 'The deployment\\'s application-wide access ledger. It answers who asked to see across every tenant, why, which SECOND administrator agreed, how long the window lasted, and how it ended.',\n lifecycleRole: 'A platform administrator requests, stating a reason. The request is never usable on creation. A DIFFERENT platform administrator approves or denies it; the requester may withdraw or refuse their own request but can never approve it. Either can revoke an active window early, and expiry ends it automatically. Completed requests remain available as access-review history.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.AUTH,\n\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ApplicationAccessGrantSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'applicationAccessGrantsResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'APPLICATION_ACCESS_GRANTS',\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n customEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ApplicationAccessGrants_Operations',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'The `status` vocabulary is SHARED with `platformAccessGrants` (`PlatformAccessGrantStatus`) rather than duplicated. The states really are the same states, and two enums holding the same five members is how a sweep, an admission predicate and a UI come to disagree about what `active` means.',\n 'There is no auto-approval and therefore no `autoApprovalReason` field. The tenant grant auto-approves when the tenant has not opted into approval or cannot approve — both statements about a NAMED tenant, and this row names none. A grant that could approve itself would make the two-person rule ceremonial.',\n 'No public CREATE or UPDATE. `requestAccess` is the only writer of a new row, and `approve` / `deny` / `revoke` / `expire` are the only status transitions. A generic CREATE would let a caller author their own `status` and mint an ACTIVE application-wide elevation with no second signature at all.',\n 'No DELETE, and one route-less DELETE_MANY. Nothing but the retention-class sweep removes a row: this is a REFERENCE child of the APPLICATION row that outlives it on purpose (#3355: deleting the application must not shorten the period its access evidence is kept for), and with no period the rows would outlive every statement the application makes about its access evidence. Bound to `AUDIT_LOGS` from creation. INTERNAL_CALL registers no route, so no caller can erase a grant from the record.',\n 'The lifecycle audit event is shared too: `CoreAuditableEventType.PLATFORM_ACCESS_GRANT_LIFECYCLE`, carrying `grantScope: application_wide` and no `targetOrganizationId`. One event so a reviewer asking \"what elevated access was granted, to whom, by whom?\" gets one query rather than a union of two they have to remember.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Identifier for one application-wide elevation request.',\n whyItMatters: 'The address of every subsequent decision, and the value the audit trail carries as `authorizingGrantId` when a read is admitted under it — which is what joins an operator\\'s reads to the two administrators who signed for them.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n applicationId: schemaShape.applicationId.foreignKeySpec({\n meaning: 'The deployment this elevation is inside.',\n whyItMatters: 'Every row carries it, although the schema marks it optional: the application is part of the request path, so it is always known.',\n importance: FieldSemanticImportance.CONTEXTUAL,\n }),\n operatorUserId: schemaShape.operatorUserId.foreignKeySpec({\n meaning: 'The platform administrator who requested the elevation.',\n whyItMatters: 'Server-authored from the session, never client-supplied, and it is the field the two-person rule measures against: `approve` refuses when the approver equals this value. An elevation whose subject the caller could choose would let one administrator mint application-wide access under another\\'s name and then sign it themselves.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n justification: schemaShape.justification.stringSpec({\n meaning: 'Why the operator needs to see across every tenant, in their own words.',\n whyItMatters: 'Required, and it carries more weight here than on the tenant grant: it is the ONLY thing the approving administrator has to decide on. A tenant grant\\'s approver knows their own tenant and their own support case; this approver knows nothing but this sentence. A second signature on an unstated reason is a countersignature on nothing.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Where this elevation is in its lifecycle.',\n whyItMatters: 'Read together with `expiresAt`, never alone: the admission predicate accepts ACTIVE and then re-checks the window, so a grant whose window elapsed stops working whether or not anything has relabelled it. Every row starts PENDING_APPROVAL — there is no branch that reaches ACTIVE without a second administrator acting.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'PlatformAccessGrantStatus',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n }),\n expiresAt: schemaShape.expiresAt.dateSpec({\n meaning: 'When the elevation stops working.',\n whyItMatters: 'The control, not the label. Server-authored from the requested duration and clamped to ONE HOUR — a quarter of the tenant grant\\'s ceiling, because this elevation reaches every customer at once and no customer can see or revoke it, so the clock is the only thing that ends it on its own.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n approvedByUserId: schemaShape.approvedByUserId.foreignKeySpec({\n meaning: 'The SECOND administrator who signed.',\n whyItMatters: 'The whole feature, as a field. It is optional in the schema because it is unset while pending and stays unset on a denied or revoked grant — never because an ACTIVE grant might lack one. The only writer of ACTIVE is `approve`, and `approve` refuses when this would equal `operatorUserId`.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n approvedAt: schemaShape.approvedAt.dateSpec({\n meaning: 'When the second administrator approved the elevation. Absent while it is pending and on a denied request.',\n temporalRole: 'occurred',\n }),\n decidedByUserId: schemaShape.decidedByUserId.foreignKeySpec({\n meaning: 'The administrator who made the last decision on the grant: approved, denied or revoked it.',\n whyItMatters: 'Answers who refused a request or ended a window early, which the approver field cannot, and keeps the last decision\\'s reason attached to the person who gave it. Written by `approve`, `deny` and `revoke`; expiry is not a decision and leaves it alone.',\n }),\n operatorName: schemaShape.operatorName.stringSpec({ meaning: 'The operator who requested the elevation, by name: `operatorUserId`\\'s label fallback. Resolved at read time from the person\\'s profile, else their account\\'s email (`forwardedUserName`, opted in for the operator only); never stored, so the row keeps only the id (#1852).', whyItMatters: 'A tenant administrator approving an operator usually may not read the operator\\'s account, so the reference alone could not say who is asking. Hidden from display: the person is shown through the foreign key, and this name is its label when the viewer may not read the user.' }),\n approvedByName: schemaShape.approvedByName.stringSpec({ meaning: 'The administrator who approved, by name: `approvedByUserId`\\'s label fallback. Resolved at read time from the person\\'s profile, and absent when they have none (`forwardedUserName`; never their email); never stored, so the row keeps only the id (#1852).', whyItMatters: 'Hidden from display: the person is shown through the foreign key, and this name is its label when the viewer may not read the user.' }),\n decidedByName: schemaShape.decidedByName.stringSpec({ meaning: 'The administrator who made the last decision, by name: `decidedByUserId`\\'s label fallback. Resolved at read time from the person\\'s profile, and absent when they have none (`forwardedUserName`; never their email); never stored, so the row keeps only the id (#1852).', whyItMatters: 'Hidden from display: the person is shown through the foreign key, and this name is its label when the viewer may not read the user.' }),\n decidedAt: schemaShape.decidedAt.dateSpec({\n meaning: 'When the last decision was made.',\n whyItMatters: 'Places a refusal or an early revocation in time against the access it ended.',\n temporalRole: 'occurred',\n }),\n purpose: schemaShape.purpose.enumSpec({\n meaning: 'What the elevation admits, and so what the second administrator signs for: tenant-spanning reads, or a window onto the doors declared to overrule an organization, on the organization in `targetOrganizationId`.',\n whyItMatters: 'The two acts are not one act. A read changes nothing and names no tenant; an overrule changes one organization\\'s rows against its will. A window approved for one never admits the other, so an approver who signed for reading the directory has not signed for releasing a tenant\\'s vendor account. Set at request time and never updated. A request that states none asks for reads.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'ApplicationAccessGrantPurpose',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n }),\n targetOrganizationId: schemaShape.targetOrganizationId.stringSpec({\n meaning: 'The one organization a `tenant_overrule` elevation may act on. Absent on every other purpose.',\n whyItMatters: 'Names the tenant the second administrator agreed to overrule, so the window cannot be spent on another. Re-read at request time (an organization that does not exist is refused) and compared with the organization of the row the act would change.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n targetOrganizationName: schemaShape.targetOrganizationName.stringSpec({\n meaning: 'What the target organization was called when the overrule was requested. Absent on every other purpose.',\n whyItMatters: 'What the approver reads to know whom they are signing against. A snapshot, not a lookup: the approver holds no grant into that tenant, so resolving the id would be a crossing of its own. Written from the organization the request re-read; the id stays the authority the admission compares.',\n semanticRole: 'label',\n }),\n grantedMachineCredential: schemaShape.grantedMachineCredential.objectSpec({\n meaning: 'The one machine credential of this application — an API key or an OAuth client — the elevation is for, when it is for a machine rather than the requester.',\n whyItMatters: 'Under independent audit-read approval a machine could otherwise never read, since a grant was keyed on a user and a machine has none — so an assurance collector, the reader that policy most wants governed, was shut out. When set, the grant admits exactly that credential and NEVER the administrator who requested it: naming a machine must not be a way to mint oneself a window. Validated against the live credential at request time and never updated, because re-pointing a signed grant at another credential would be a grant nobody signed. Like any read grant it satisfies EVERY read that requires one — not only the audit viewer — so what the credential can actually read is still bounded by the roles it holds: give it the read-only audit-evidence reader role, which reaches the audit viewer and nothing else. A machine is never granted an overrule: that is a person\\'s decision.',\n importance: FieldSemanticImportance.CONTEXTUAL,\n }),\n decisionReason: schemaShape.decisionReason.stringSpec({\n meaning: 'The reason given with the LAST decision — an approval, a refusal or a revocation — belonging to `decidedByUserId`. A decision given without one clears it.',\n whyItMatters: 'What a later reader needs to tell a refusal that was considered from one that was reflexive. Scrubbed on subject erasure, like the justification, because it is free text one administrator wrote about another\\'s request.',\n importance: FieldSemanticImportance.CONTEXTUAL,\n }),\n },\n\n operations: {\n [Op.READ]: {\n purpose: 'Read one application-wide elevation request.',\n outcome: 'The request\\'s current state, including who asked, who signed and when the window closes.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The elevation request is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator. There is no tenant-side reader here — an application-wide elevation has no customer to show it to, which is exactly why its approval had to become a second signature.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Read a pending request',\n request: { applicationAccessGrantId: APPLICATION_ACCESS_PENDING_GRANT_ID },\n response: applicationAccessPendingGrantExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.LIST]: {\n purpose: 'List elevation requests — the pending queue a second administrator works from, and the history a reviewer reads.',\n outcome: 'A page of elevation requests.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A page of elevation requests is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n ],\n idempotent: true,\n examples: [{\n title: 'Work the pending queue',\n request: { page: 1, limit: 20, sort: 'createdAt:desc' },\n // The framework's page envelope: the counts sit under `pagination` (#1838: they were at the top level).\n response: { data: [applicationAccessPendingGrantExample], pagination: { page: 1, limit: 20, total: 1, totalPages: 1 } },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [Op.COUNT]: {\n purpose: 'Count elevation requests matching a filter.',\n outcome: 'A number — how many requests are pending a signature, or how many were granted in a period.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The count is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n ],\n idempotent: true,\n examples: [{\n title: 'How many requests are awaiting a second signature',\n request: { status: PlatformAccessGrantStatus.PENDING_APPROVAL },\n response: { count: 1 },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [ApplicationAccessGrants_Operations.REQUEST_ACCESS]: {\n operationId: ApplicationAccessGrants_Operations.REQUEST_ACCESS,\n purpose: 'Ask for a short, justified window in which the tenant-spanning reads become available, or in which the doors declared to overrule an organization may act on one named organization.',\n outcome: 'A request in `pending_approval`, usable by nobody until a DIFFERENT platform administrator approves it. The window is recorded at creation and starts running then, so a request nobody signs simply lapses.',\n whenToUse: 'An operator needs an elevation-gated read that names no single tenant (the user directory, or the audit viewer with independent approval enabled, for a support case or incident spanning customers), or must overrule one organization through a door that declares it, such as releasing a vendor account the organization holds (`purpose: tenant_overrule`, `targetOrganizationId`).',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The elevation request was recorded and awaits a second administrator.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The justification is missing or empty. It is required because it is the only thing the approver has to decide on.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: '`grantedMachineCredential` names no active, unexpired API key or OAuth client of this application. The refusal does not say which condition failed.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The purpose and the target do not fit: a `tenant_overrule` that names no organization, names one that does not exist, or binds a machine credential; or a read that names an organization.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Ask to see across tenants for a multi-customer incident',\n request: {\n justification: 'Incident INC-5107 spans several tenants; I need the audit view, configured for independent approval, to find which are affected.',\n requestedDurationMinutes: 30,\n },\n response: applicationAccessPendingGrantExample,\n forStatus: HttpResponseStatusCode.CREATED_201,\n }],\n },\n [ApplicationAccessGrants_Operations.APPROVE]: {\n operationId: ApplicationAccessGrants_Operations.APPROVE,\n purpose: 'Sign another administrator\\'s request — the second signature.',\n outcome: 'The request becomes `active` and names the approver. Until the window closes what its purpose names becomes available to exactly one principal: the tenant-spanning reads, or the one overrule of the named organization, to the REQUESTER — or, for a read grant bound to a machine credential, to that credential and not the requester.',\n whenToUse: 'A platform administrator has read the requester\\'s justification and purpose (and, for an overrule, the organization it names) and agrees that act is warranted.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The elevation is now active, and its updated state — including the approver — is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller IS the requester — a request cannot be approved by the person who raised it.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The request is no longer `pending_approval`.' },\n ],\n idempotent: false,\n examples: [{\n title: 'A second administrator signs',\n request: {\n applicationAccessGrantId: APPLICATION_ACCESS_PENDING_GRANT_ID,\n decisionReason: 'Reviewed against INC-5107; scope and window are proportionate.',\n },\n response: applicationAccessActiveGrantExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [ApplicationAccessGrants_Operations.DENY]: {\n operationId: ApplicationAccessGrants_Operations.DENY,\n purpose: 'Refuse a pending request.',\n outcome: 'The request becomes `denied` and cannot be retried; a later need requires a new request.',\n whenToUse: 'A platform administrator judges the reach unwarranted — or the requester themselves thinks better of it.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The request was denied, and its final state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The request is no longer `pending_approval`.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Withdraw your own request',\n request: {\n applicationAccessGrantId: APPLICATION_ACCESS_PENDING_GRANT_ID,\n decisionReason: 'The affected tenants were identified from the incident channel; the wide read is no longer needed.',\n },\n response: {\n ...applicationAccessPendingGrantExample,\n status: PlatformAccessGrantStatus.DENIED,\n decisionReason: 'The affected tenants were identified from the incident channel; the wide read is no longer needed.',\n updatedAt: '2026-09-09T13:06:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [ApplicationAccessGrants_Operations.REVOKE]: {\n operationId: ApplicationAccessGrants_Operations.REVOKE,\n purpose: 'End a pending or active elevation early.',\n outcome: 'The elevation becomes `revoked` and the tenant-spanning reads stop immediately instead of remaining available until the recorded expiry.',\n whenToUse: 'The support work finished before the window did, or a reviewer decides the reach should end now.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The elevation was revoked, and its final state is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform super-administrator.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No elevation request with the supplied id exists.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The elevation is already denied, revoked or expired. Only a `pending_approval` or `active` one can be revoked.' },\n ],\n idempotent: false,\n examples: [{\n title: 'Close the window as soon as the incident is scoped',\n request: {\n applicationAccessGrantId: APPLICATION_ACCESS_ACTIVE_GRANT_ID,\n decisionReason: 'INC-5107 scoped to three tenants; per-tenant grants requested instead.',\n },\n response: {\n ...applicationAccessActiveGrantExample,\n status: PlatformAccessGrantStatus.REVOKED,\n decisionReason: 'INC-5107 scoped to three tenants; per-tenant grants requested instead.',\n updatedAt: '2026-09-09T13:18:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n [ApplicationAccessGrants_Operations.EXPIRE]: {\n operationId: ApplicationAccessGrants_Operations.EXPIRE,\n purpose: 'Relabel an active elevation whose window has closed.',\n outcome: 'The elevation reads `expired` rather than `active` in the queue and the history.',\n whenToUse: 'Never by hand. The credential-expiry sweep dispatches it and nothing else does — there is no route and no affordance, because nobody needs a button that declares a date has passed.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The elevation was relabelled expired.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The elevation is not `active`. A denied or revoked one is terminal and must keep saying which — relabelling it would rewrite the decision history a reviewer reads.' },\n ],\n idempotent: false,\n examples: [{\n title: 'The sweep closes a lapsed window',\n request: {},\n response: {\n ...applicationAccessActiveGrantExample,\n status: PlatformAccessGrantStatus.EXPIRED,\n updatedAt: '2026-09-09T13:31:00.000Z',\n },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n\n businessConstraints: [\n 'THE control: `approve` refuses when the approver is the requester. Enforced TWICE, and neither half alone is the control — the operation\\'s `enabledCondition` makes the affordance disappear so no console renders an Approve button on one\\'s own request, and the custom implementation makes the transition impossible so a future variant authored without that condition cannot transition silently. The comparison itself lives in ONE exported predicate, which fails CLOSED when either identity is missing: an approval reaching the check with no decider has no second person behind it, and the naive inline form would admit exactly that case.',\n 'Customer approval is the industry ceiling and is structurally unavailable here — there is no single customer to ask — so a second signature is the strongest control that exists for this act. That is why AUTO-APPROVAL was rejected even though it is the tenant grant\\'s own default posture: that default is defensible only because a tenant can opt in above it, and there is no such party here.',\n 'Application-wide directory and declared cross-tenant reads retain their elevation gate. The application audit viewer and the assurance evidence doors are the explicit policy exception: auditTrail.applicationReadAccess, when undeclared, follows the application\\'s shape in all environments (#2618): AuditApplicationReadAccess.INDEPENDENT_APPROVAL, which requires this grant, where the parties of some relationship kind are independent of the operator, and ROLE_BASED otherwise. Both modes keep administrator-role checks and crossing observations; role-based evidence carries no fabricated grant id. Grant requests themselves are never auto-approved.',\n 'The per-row tenant crossing is deliberately NOT gated on this grant. That door already works, approved by the customer it names; requiring an application-wide elevation there too would replace a customer-approvable control with a platform-internal one, which is a step DOWN the operator-access ladder.',\n 'Both grant resources are EXEMPT from the admission wholesale — this one and `platformAccessGrants`. An operator would otherwise need an application-wide grant in order to ask for one, and the second administrator would need one in order to read the queue and sign. The exemption is safe for the reason the tenant resource\\'s own bootstrap exemption is safe: these rows are the elevation ledger, they belong to no tenant, and reading them discloses no customer\\'s data.',\n 'Usability is EVALUATED, never read off `status`. A grant counts only when it is ACTIVE and `expiresAt` is still in the future, through the single predicate both grant resources share. The expiry sweep\\'s relabelling is bookkeeping for humans; if admission read the label, a lagging sweep would be an authorization hole rather than a stale display.',\n 'The window is SHORTER than a tenant elevation\\'s — 30 minutes by default against 60, one hour maximum against four — and the ORDER is the design rather than the numbers. A tenant elevation reaches one customer who can see and revoke it; this one reaches every customer and none of them can.',\n 'Terminal statuses are how an elevation ends. DENIED, EXPIRED and REVOKED are never edited back to life, and there is no delete verb of any kind: an elevation record either party could erase is not evidence.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n ),\n () => ({\n label: {\n purpose: 'The request\\'s justification, the one thing the approving administrator decides on. It is a summary field, so the list card carries it; naming a card by the request instant, when that was not a summary field, showed the raw id on every card (#2329). A row whose justification was masked on erasure is named by the instant it was made (a summary field since #3066, so the list carries it too), then by its id. The record carries the requesting operator only as a user id, and a synchronous label cannot resolve a name, so the operator is shown — resolved to the person — as the first row of the body and on the card instead.',\n },\n layout: {\n purpose: 'Three sections that separate the two identities the control exists to keep apart: `request` (who asked and why), `decision` (who signed and why), `window` (how long, and which credential it admits). Folding decision into request would put requester and approver in one block, which is precisely the distinction `applicationAccessGrantApproverIsDistinct` enforces.',\n displayPurpose: 'Read-only. Every state change goes through a named verb — request, approve, deny, revoke, expire — and none through a form, so there is deliberately no edit layout. The header carries the request instant and the status badge; the three titled cards follow, with no descriptions. Both identities resolve to the person. The decision reason and the machine credential hide when empty; the approver row stays, because on a pending request its emptiness is the answer.',\n summaryPurpose: 'A card titled with the record\\'s name (its justification, else the request instant, else its id), then who asked, the status badge, and the expiry labelled.',\n sections: {\n request: {\n purpose: 'The requesting operator and the stated justification. Status and the instant are the page header.',\n whenToUse: 'The review queue, and the first block of any single-grant read.',\n textSlots: {\n title: { purpose: 'Label the request block: who asked, and why.' },\n },\n },\n decision: {\n purpose: 'The second administrator and when they signed, the administrator who made the LAST decision (approved, denied or revoked) and when, and that decision\\u2019s reason. A denial or a revocation is read against its own decider, never against the approver.',\n whenToUse: 'Auditing whether an elevation was independently approved, and on what grounds.',\n textSlots: {\n title: { purpose: 'Label the signature block.' },\n },\n },\n window: {\n purpose: 'Expiry, and the machine credential the grant admits when it was requested for one.',\n whenToUse: 'Judging live exposure, and confirming a grant admits the credential it was meant to.',\n textSlots: {\n title: { purpose: 'Label the validity block.' },\n },\n },\n },\n },\n views: {\n [Op.LIST]: { purpose: 'The review queue, reached from Settings → Administration → Access grants. A `status` quick-filter over `createdAt` day buckets, because an unsigned request is the only row that needs anybody.', whenToUse: 'Signing off pending elevations, and reviewing what has been held recently.' },\n [Op.READ]: { purpose: 'One elevation in full, including both identities and the stated reasons.', whenToUse: 'Auditing a specific window after the fact.' },\n [ApplicationAccessGrants_Operations.REQUEST_ACCESS]: { purpose: 'The bootstrap verb. Writes PENDING_APPROVAL, never ACTIVE.', whenToUse: 'An operator needs an application-wide read and does not yet hold a window.' },\n [ApplicationAccessGrants_Operations.APPROVE]: { purpose: 'The second signature; refuses the requester.', whenToUse: 'A different administrator has read the justification and accepts it.' },\n [ApplicationAccessGrants_Operations.DENY]: { purpose: 'Terminal refusal, with a recorded reason.', whenToUse: 'The justification does not hold.' },\n [ApplicationAccessGrants_Operations.REVOKE]: { purpose: 'Ends an ACTIVE window before its expiry.', whenToUse: 'Circumstances changed, or the elevation is no longer needed.' },\n [ApplicationAccessGrants_Operations.EXPIRE]: { purpose: 'ACTIVE → EXPIRED, dispatched by the credential-expiry sweep and by nothing else. Headless — no person invokes it.', whenToUse: 'Never by hand; use REVOKE to end a window early.' },\n },\n }),\n);\n"]}
|
package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-subject-requests.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/compliance/resources/data-subject-requests.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAI3B,yBAAyB,EACzB,sBAAsB,EAGtB,wBAAwB,EACxB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"data-subject-requests.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/compliance/resources/data-subject-requests.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,OAAO,EACL,qBAAqB,IAAI,EAAE,EAI3B,yBAAyB,EACzB,sBAAsB,EAGtB,wBAAwB,EACxB,8BAA8B,EAK/B,MAAM,uBAAuB,CAAC;AAqE/B,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;iCAydpD,CAAC"}
|
package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { dataSubjectRequestsResourceUIBehavior as dataSubjectRequestsUIBehaviorSource } from '@wildo-ai/presets-components';
|
|
16
16
|
import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
17
17
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance, } from '@wildo-ai/zod-decorators';
|
|
18
|
-
import { CoreResourceOperation as Op, DATA_SUBJECT_ERASURE_GRACE_WINDOW_DAYS, DATA_SUBJECT_EXPORT_AVAILABILITY_DAYS, DATA_SUBJECT_REQUEST_DEADLINE_SAFETY_MARGIN_DAYS, DataSubjectRequestChannel, DataSubjectRequestKind, DataSubjectRequestRefusalCode, DataSubjectRequestSchema, DataSubjectRequestStatus, DataSubjectRequests_Operations, ResourcePrimaryScope, CoreUserNotificationTarget, dataSubjectRequestsResourceConfiguration_InitializationFactory as dataSubjectRequestsFactory, } from '@wildo-ai/saas-models';
|
|
18
|
+
import { CoreResourceOperation as Op, DATA_SUBJECT_ERASURE_GRACE_WINDOW_DAYS, DATA_SUBJECT_EXPORT_AVAILABILITY_DAYS, DATA_SUBJECT_REQUEST_DEADLINE_SAFETY_MARGIN_DAYS, DataSubjectRequestChannel, DataSubjectRequestKind, DataSubjectRequestRefusalCode, DataSubjectRequestSchema, DataSubjectRequestStatus, DataSubjectRequests_Operations, ErrorCustomMessageReference, ResourcePrimaryScope, CoreUserNotificationTarget, dataSubjectRequestsResourceConfiguration_InitializationFactory as dataSubjectRequestsFactory, } from '@wildo-ai/saas-models';
|
|
19
19
|
import { HttpResponseStatusCode, ResourceOperationScheduledExecutionVariantType, resourceFrontendConfiguration, resourceSpecification, resourceSpecificationFromFrontendConfiguration, } from '../../../_core/index.js';
|
|
20
20
|
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
21
21
|
const dataSubjectRequestsUIBehavior = dataSubjectRequestsUIBehaviorSource;
|
|
@@ -358,6 +358,9 @@ export const dataSubjectRequestsResourceSpecification = resourceSpecificationFro
|
|
|
358
358
|
importance: FieldSemanticImportance.PRIMARY,
|
|
359
359
|
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The request was withdrawn and returned in cancelled state.' }],
|
|
360
360
|
errorScenarios: [
|
|
361
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The request is no longer waiting to be carried out (it is not scheduled or received): the engine refuses on the operation\'s condition before it runs.', customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_DISABLED },
|
|
362
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The request moved after this one was admitted (another withdrawal, or the sweep carried it out), so nothing was written. Read it again.', customMessageReference: ErrorCustomMessageReference.VERSION_CONFLICT },
|
|
363
|
+
// Re-checked on the row the condition judged, so a client normally meets the two rows above, never this code.
|
|
361
364
|
{ code: HttpResponseStatusCode.CONFLICT_409, errorCode: DataSubjectRequestRefusalCode.NOT_WITHDRAWABLE, when: 'The request is already cancelled, completed or failed, so it can no longer be withdrawn.' },
|
|
362
365
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No request with that id is visible to the signed-in person.' },
|
|
363
366
|
],
|
|
@@ -446,6 +449,7 @@ export const dataSubjectRequestsResourceSpecification = resourceSpecificationFro
|
|
|
446
449
|
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The request can be downloaded now.' }],
|
|
447
450
|
errorScenarios: [
|
|
448
451
|
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No request with that id belongs to the signed-in person.' },
|
|
452
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The request is not an export available for download (still being prepared, expired, or not an export at all): the engine refuses on the operation\'s condition before it runs. NOT_DOWNLOADABLE arrives instead for a copy whose download window ended before the sweep withdrew it, and always from the streaming route, which the condition does not guard.', customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_DISABLED },
|
|
449
453
|
{ code: HttpResponseStatusCode.CONFLICT_409, errorCode: DataSubjectRequestRefusalCode.NOT_DOWNLOADABLE, when: 'The request is not a copy of the person\'s data, or its download window ended.' },
|
|
450
454
|
],
|
|
451
455
|
idempotent: true,
|
|
@@ -454,7 +458,7 @@ export const dataSubjectRequestsResourceSpecification = resourceSpecificationFro
|
|
|
454
458
|
[DataSubjectRequests_Operations.SWEEP_DUE_REQUESTS]: {
|
|
455
459
|
operationId: DataSubjectRequests_Operations.SWEEP_DUE_REQUESTS,
|
|
456
460
|
purpose: 'Carry out every due erasure through the engine\'s system-level subject-erasure door and record what happened, and mark expired every copy whose download window ended.',
|
|
457
|
-
outcome: 'Each due request is attempted and marked COMPLETED, COMPLETES_AT_VENDOR, EXTERNAL_WORK_OWED or FAILED with a receipt; a legal hold, an unexecuted edge, an incomplete external effect, an unconfirmed severance, a session that did not end or a thrown erasure makes it FAILED for an operator.',
|
|
461
|
+
outcome: 'Each due request is attempted and marked COMPLETED, COMPLETES_AT_VENDOR, EXTERNAL_WORK_OWED or FAILED with a receipt; a legal hold, an unexecuted edge, an incomplete external effect, an unconfirmed severance, a session that did not end or a thrown erasure makes it FAILED for an operator. An organization the person owned and was the only member of goes with them (#3786): it is marked for deletion before the erasure, the purge removes it at the end of the tenant retention window, and the receipt names it with that date. An organization someone else still belongs to keeps the owner-floor refusal (`LAST_ORGANIZATION_OWNER`), recorded as FAILED until another owner is appointed.',
|
|
458
462
|
importance: FieldSemanticImportance.PRIMARY,
|
|
459
463
|
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The run\'s counters; every due request was attempted and requests not yet due were left scheduled.' }],
|
|
460
464
|
errorScenarios: [{ code: HttpResponseStatusCode.INTERNAL_SERVER_ERROR_500, when: 'The sweep could not list scheduled requests or acquire system access. A failed erasure is caught and recorded as FAILED; a failed receipt write is logged and leaves the request scheduled.' }],
|