// @requirements REQ-PRODUCT-RECORDING-INSPECTION // @requirements REQ-PRODUCT-MARKETING-AUTHORING // @requirements REQ-PRODUCT-PACK-CAPABILITIES // @requirements REQ-PRODUCT-PROCESSING-WORKBENCH // @requirements REQ-PRODUCT-FORM-PERMISSION-CONNECTION // @requirements REQ-PRODUCT-COLLECTION-REHEARSAL // @requirements REQ-PRODUCT-COLLECTION-WORKBENCH // @requirements REQ-PRODUCT-PUBLICATION-INSPECTION // @requirements REQ-PRODUCT-TERMS-RECOVERY // @requirements REQ-PRODUCT-COLLECTION-FLOW REQ-TR-BASIS // @requirements REQ-PRODUCT-DOCUMENT-EXPLANATION // @requirements REQ-JP-RELATED-SCOPE REQ-JP-RECIPIENT-CONSENT REQ-JP-RELATED-FOREIGN // @requirements REQ-SG-CONSENT-CONDITIONS REQ-SG-CONSENT-ROUTES REQ-SG-WITHDRAWAL REQ-SG-ACCOUNTABILITY // @requirements REQ-PRODUCT-CONSENT-NOTICE-FILES // @requirements REQ-PRODUCT-PRIVACY-CHOICE-LINK // @requirements REQ-PRODUCT-CONTRACT-LOCALIZATION // @requirements REQ-PRODUCT-TERMS-AUTHORING // @requirements REQ-PRODUCT-EMBED-LOCALIZATION // @requirements REQ-PRODUCT-TERMS-CONNECTION // @requirements REQ-PRODUCT-INDIRECT-LOCALIZATION // @requirements REQ-PRODUCT-PROCESSING-LOCALIZATION // @requirements REQ-PRODUCT-AUTHORED-PREVIEW // @requirements REQ-PRODUCT-STORAGE-LOCALIZATION // @requirements REQ-PRODUCT-TERMS-ADAPTERS // @requirements REQ-PRODUCT-CONNECTION-INSPECTION // @requirements REQ-PRODUCT-RIGHTS-LOCALIZATION // @requirements REQ-PRODUCT-RIGHTS-AUTHORING // @requirements REQ-PRODUCT-SPECIALIST-PACKS // @requirements REQ-PRODUCT-CONSUMER-PACKS // @requirements REQ-PRODUCT-PUBLICATION-CHECK // @requirements REQ-PRODUCT-PRIVACY-PACKS REQ-NZ-INDIRECT // @requirements REQ-EU-INTERESTS-DISCLOSURE // @requirements REQ-QC-PROFILING // @requirements REQ-PRODUCT-AGENT-INTEGRATION // @requirements REQ-US-OR-GPC REQ-US-MN-GPC REQ-US-TX-AGENT-SIGNALS import {getPrivacySignalReviews} from './privacy-signal-reviews.js'; // @requirements REQ-US-CA-UI import {getPrivacyInterfaceReviews} from './privacy-interface-reviews.js'; // @requirements REQ-SG-COOKIE-DATA REQ-SG-BROWSER-CHOICE REQ-SG-COOKIE-TARGETING import {getCookieJurisdictionReviews} from './cookie-jurisdiction-reviews.js'; // @requirements REQ-ZA-MARKETING import {getMarketingRequestReviews} from './marketing-request-reviews.js'; import {setupQuestions,setupMarkets,setupFactFields} from './setup.js'; import type {SetupQuestionId} from './setup.js'; interface Target { title:string; outcome:string; configPaths:string[]; hostWork:string[]; questionIds:SetupQuestionId[]; factsNeeded:string[]; guides:string[]; prerequisites:string[]; verify:string[]; requiredConfigPaths?:string[];requiredSomeItemConfigPaths?:string[]; conditionalConfig?:{when:'site-locale-not-english';requiredPaths:string[];reason:string}[]; } const targets:Record={ 'legal-pages':{ title:'Privacy, cookie and terms pages',outcome:'Static documents or article fragments in the host layout.', configPaths:['site','controller','jurisdictions','purposes','purposes.legitimateInterests','services','storage','privacy','terms','documents'], hostWork:['Review actual section inputs with notabenda explain --config FILE --document privacy|cookies|terms --preview --json, or explainLegalDocument from @notabenda/core/content. Current-input paths and origin do not establish legal approval, MDX source attribution or publication.','Choose routes and build integration; supply reviewed wording. Rendering a document does not collect agreement or gate services.','The CLI builds all three configured documents from JSON, YAML or Markdown-frontmatter site configuration. Use renderer fragments when the host needs only selected documents.','For Markdown/MDX, preview the actual compiled build with createAuthoredReleasePreview from @notabenda/authoring/preview. Export that same build; configuration previews do not show custom-component HTML.','Keep the intended trusted public artifact. After deployment explicitly run notabenda check-publication --artifact FILE --origin HTTPS_ORIGIN; this performs four anonymous reads of pinned release files.'], questionIds:['personal-data','transfers'],factsNeeded:['Public operator/contact facts','Actual processing purposes, legal bases, categories, collection, retention, recipients and transfers; public interests pursued and by whom where legitimate interests applies (purposes.legitimateInterests)','Intended audience and service type','Document routes, revisions and review state'],guides:['package','document-inputs','authoring','authored-preview','publication-check'],prerequisites:[], verify:['Legal routes render without JavaScript.','Check pinned publication: canonical artifact JSON and exact privacy/cookie/terms HTML bytes. Current routes, active bindings and controls still need separate tests.','Public output excludes private fields.','Production validation rejects unresolved facts and draft declarations.'] }, 'authored-documents':{ title:'Markdown or MDX documents',outcome:'Build-time authored documents with YAML frontmatter and retained revisions.', configPaths:['documents'],hostWork:['Use @notabenda/authoring compileAuthoredDocuments, not a Markdown CLI flag.','Treat MDX imports/components as trusted build code; keep source archives private.'], questionIds:['authored-content'],factsNeeded:['Trusted source files and component imports','Stable section IDs, document version/effective date and actual review decision'],guides:['authoring','authored-preview','releases'],prerequisites:['legal-pages'],verify:['Compile the actual sources.','Verify public HTML and private source archive separation.','Pinned prior versions survive a clean build.'] }, 'cookie-consent':{ requiredConfigPaths:['consent','consent.purposes','consent.services'], title:'Cookie and optional-service controls',outcome:'Optional loaders run only while their declared purpose/service permission is effective.', configPaths:['purposes','services','storage','consent','consent.purposes','consent.services','consent.information','scopeGuards'],hostWork:['Compile and fully validate the site in build/SSR code with compileConsentRuntimeConfig from core/content, or build --consent-runtime local|required. Primary createConsent takes that descriptor only and returns a narrow cookie inventory. Required receipts need requiredConsentEvidence from core/consent/evidence. Do not bundle the compiler or infer full-site fields from the browser controller.','Register actual start/cleanup lifecycles and remove parallel tags, hints or loaders. Inspect the actual controller with @notabenda/core/consent/inspect; registration and matching inventory do not prove application behavior.','Choose vanilla, React or Astro controls around the same controller. Read privacyInterfaceReviews for California choice-path review; paired cookie buttons do not implement sale/sharing or sensitive-information rights. Read cookieJurisdictionReviews for selected jurisdiction checks and source-version limits. Singapore consentRoutes are legal-route explanations, not runtime modes. Japan recipient assessments are not performed by a cookie choice. Market interest and browser defaults do not create permission or qualify an exception.'], questionIds:['optional-storage','children','sensitive-data','high-risk-profiling','regulated-sector'],factsNeeded:['Actual optional loaders, storage names/types and cleanup targets','Purpose/service IDs and deliberate material scope revisions','Grant/refusal lifetimes and dismissal interval','Scope assessments; present or unknown specialized processing remains gated'],guides:['browser-config','consent','connection-inspection','storage-cleanup','scope-guards','react','astro'],prerequisites:['legal-pages'],verify:['No optional request on initial load or after rejection.','Granular grants start only the selected work.','Withdrawal stops owned work and clears declared markers.','Reload, changed scopes and failure states retain restrictions.'] }, 'technology-functions':{ requiredConfigPaths:['scopeGuards'], title:'Technology collection notices',outcome:'A static, versioned disclosure of identification, location or profiling functions and their activation method.',configPaths:['purposes','services','consent.services.scope','scopeGuards','documents.privacy'],hostWork:['Use the optional build-only @notabenda/core/technology API; supply reviewed function/activation copy and assign technologyCollectionScope(settings) before compiling.','Place the notice before every activation opportunity, including global choices; use existing gated lifecycles and on-demand native controls when appropriate.','Retain the exact descriptor separately from its legal artifact. Ordinary consent receipts do not automatically archive this supplemental notice.','Select one consent-managed service with its complete set of at most eight purposes, direct/both collection sources, only optional owned storage and explicit supported scope assessments. Never weaken guards to use this builder.','Author the complete declaration with host wording, function labels and direction. This is separate from localization.collection; verify the descriptor against the retained legal artifact.'],questionIds:['technology-functions','technology-isolation','technology-activation-controls'],factsNeeded:['Actual covered technology, provider and all collection purposes','Necessity, applicable scope and specialized processing assessment','Public function declarations, activation instructions, complete host-language labels and review','Fresh service material scope and actual cleanup'],guides:['specialist-packs','technology-collection','consent','scope-guards'],prerequisites:['cookie-consent'],verify:['The disclosure and activation instructions render without JavaScript.','Opening the controls does not activate the function.','Old generic grants cannot start the new function.','Actual service starts, withdrawal, receipt failure and processing restrictions retain the existing gates.'] }, 'storage-exceptions':{ requiredConfigPaths:['storageExceptions','storageExceptions.entries','scopeGuards'], title:'Assessed storage-exception settings',outcome:'Separate objection controls for explicitly assessed supported storage uses, with their own preference journal and lifecycles.', configPaths:['storageExceptions','storageExceptions.entries','scopeGuards','purposes','services.processingActivities','storage','localization.storageExceptions'], conditionalConfig:[{when:'site-locale-not-english',requiredPaths:['localization.storageExceptions'],reason:'Native storage settings need the complete selected storage-exception dictionary.'}], hostWork:['Assess the selected supported profile and each declared condition; do not select it from a country or locale alone.','Register exception-owned lifecycles, hydrate the journal and present the information/objection controls before starting work. Keep exception services/purposes out of consent enrollment.','Supply complete localization.storageExceptions messages for non-English native controls, and translate the entry facts, preference notice and information link. A consent dictionary does not translate this interface. A headless host presentation remains available.','Establish every supported condition. Statistical use needs improvement-only statistics, non-identifying aggregates, no individual decisions, deletion after aggregation, no automatically emitted signals, constrained third-party use and no other use/linking. Appearance needs sole appearance/functionality, no behavioural content selection and only necessary personal data. Both require an information-society service.','Keep stable entry IDs and advance material revisions; disclose until-cleared preference storage and provide an atomic notifying journal. Splitting an SDK into IDs does not establish separation or eligibility.'], questionIds:['storage-statistical-use','storage-appearance-use','storage-exception-assessment','storage-exception-isolation','storage-objection-controls','storage-preference-journal','children','sensitive-data','high-risk-profiling','regulated-sector'], factsNeeded:['Actual service, purpose and storage ownership; technical separation from consent-managed work','Supported profile, every eligibility condition and independent processing basis assessment','Information, free objection route, preference storage and reviewed scope facts'], guides:['specialist-packs','storage-exceptions','scope-guards','storage-cleanup'],prerequisites:['legal-pages'], verify:['Initial hydration and presentation precede any managed work.','Objection immediately stops owned work and survives reload and material revisions.','Journal failure, stale tabs and unknown/present restricted scopes keep the service off.','Cookie acceptance never clears an objection.'] }, "google-basic":{"title":"Google Basic tag connection","outcome":"One document-level adapter gates explicitly declared Google destinations and all four consent signals.","configPaths":["services.googleBasic","services.googleBasic.tagIds","services.googleBasic.signals","services.resourceOrigins","services.processingActivities","consent"],"requiredSomeItemConfigPaths":["services.googleBasic"],"questionIds":["google-basic-targets","google-basic-ownership","google-connected-destinations","processing-opt-outs","receipts"],"factsNeeded":["Actual supported G-/AW- destinations, complete signal-to-purpose mappings and initial Google origin","Clean document ownership and removal of competing snippets, GTM, hints and queues","Actual account connections, processing classification, independent restrictions and any required receipts","Event payload review and full-document reset policy after a load attempt"],"guides":["specialist-packs","google-basic","consent","privacy-signals","consent-evidence"],"prerequisites":["cookie-consent"],"hostWork":["Declare supported G-/AW- targets and every signal array under services.googleBasic, plus exact consent enrollment, scopes, origin and processing classification. Empty arrays stay denied; all purposes gate the entire combined service.","Register one @notabenda/core/google adapter per document before any Google integration, outside replayed renders. Remove snippets, GTM, resource hints and competing queues; several inventory services may belong to separate pages but cannot own globals together.","Inspect actual account settings, connected destinations and event payloads. No GTM container, Advanced mode, enhanced-conversion, identity-upload or CMP certification flow is supplied.","After a script-load attempt, withdrawal, failure or cancellation requires a new document before regrant. Stop owned work and plan real reload/navigation; stop cannot guarantee post-load vendor network silence."],"verify":["No Google loader before effective permission or after initial refusal; all four denied defaults precede initialization.","Combined destinations wait for every mapped purpose, required receipt and independent processing restriction.","Withdrawal during a pending load closes events; regrant cannot restart the adapter in that document.","Discarded events never replay. Actual vendor/browser behavior and account connections need host network verification; simulator output is not certification."]}, 'embeds':{ title:'Gated media',outcome:'Remote media stays inert until its service is permitted.',configPaths:['services.resourceOrigins','localization.embeds'], conditionalConfig:[{when:'site-locale-not-english',requiredPaths:['localization.embeds'],reason:'Native gated-media placeholders need the complete matching embed dictionary.'}], hostWork:['Use inert placeholders and consent-gated resource mounting; audit initial markup and resource hints.','Supply complete localization.embeds messages for non-English placeholders, plus translated titles, descriptions and image alternatives. Full controllers select their configured dictionary; compiled cookie controllers need the separately selected embed localization. No message changes a permission or a resource origin.'],questionIds:['embeds'],factsNeeded:['Initial resource origins','Actual media elements and their owning service'],guides:['embeds'],prerequisites:['cookie-consent'],verify:['No remote src/hint before permission.','Withdrawal restores the placeholder without granting a new choice.'] }, 'terms-agreement':{ conditionalConfig:[{when:'site-locale-not-english',requiredPaths:['localization.terms'],reason:'The native non-English acceptance interface needs the complete selected terms dictionary.'}], title:'Explicit agreement to terms',outcome:'An unchecked action bound to an exact terms revision with an acknowledged receipt.',configPaths:['documents.terms','terms.agreements','localization.terms'], hostWork:['Optionally configure named terms.agreements using the agreement editor or wizard --terms FILE. Review each revision and generate offers from the final artifact with createConfiguredTermsOffer; CLI build writes agreements/terms-.json. Host-authored offers remain supported. Removing a declaration does not retire a backend offer.','Create/register the exact offer; bind a host context and transport to the agreement control.','Choose the native view or React terms provider/control or Astro named shell/bridge. For optional reload recovery, use createRecoverableTermsAcceptance from @notabenda/core/terms/recovery with an opaque host context and atomic journal. Reload must remain unchecked, storage loss cannot preserve a retry key, and cleanup follows server operation settlement/retirement. The host owns the controller, operation and uncertain-request recovery; new operation or subject requires a fresh controller and Astro context key.','A terms page alone is not an agreement flow. Keep cookie preferences separate.'],questionIds:['terms-agreement'],factsNeeded:['Action requiring agreement','Exact terms version and action wording','Host context identity, receipt admission and failure/retry behavior'],guides:['terms','terms-connection','terms-recovery'],prerequisites:['legal-pages'],verify:['Inspect the actual controller against the complete intended offer and host operation with @notabenda/core/terms/inspect; this does not check publication, backend activation or application behavior.','Initially unchecked.','Displayed document matches the offer revision.','Failure cannot appear acknowledged; successful receipt remains inspectable.','Framework mount, hydration and navigation submit nothing; replaced operations cannot inherit the previous controller or receipt.'] }, 'privacy-rights':{ conditionalConfig:[{when:'site-locale-not-english',requiredPaths:['localization.rights'],reason:'The native request page needs its complete matching message set; collection messages do not translate it.'}], requiredConfigPaths:['rightsCenter'], title:'Privacy request entry points',outcome:'A static page leading to the host’s real request workflows.',configPaths:['privacy','rightsCenter','localization.rights'],hostWork:['Use the request-page editor or wizard --rights proposal for explicit public wording, destinations and fallback. Saving changes privacy.rightsUrl to the page route only after an explicit decision. A non-English page requires complete localization.rights messages; keep the site locale.','Implement and verify request intake and fulfillment separately; retained-page checks cannot verify these workflows.'],questionIds:['personal-data','privacy-request-routes'],factsNeeded:['Available rights and action scope','Actual destinations, contact and next steps'],guides:['rights'],prerequisites:['legal-pages'],verify:['The page works without JavaScript and with keyboard navigation.','Every action reaches the intended host workflow while logged out or without a suitable account.','The public fallback works when the account route cannot be used.','Navigation never claims that a request was submitted, acknowledged or fulfilled.'] }, 'collection-notice':{ requiredConfigPaths:['purposes'], conditionalConfig:[{when:'site-locale-not-english',requiredPaths:['localization.collection'],reason:'The static non-English collection interface needs the complete selected collection dictionary.'}], title:'Information beside a collection form',outcome:'Static purpose disclosures beside host fields, linked to an exact privacy revision.', configPaths:['purposes','purposes.collection','documents.privacy','localization.collection'], hostWork:['Create and verify a collection notice for one to eight declared direct/mixed-source purposes; supply context-specific title and introduction.','For direct-only forms, form-workbench --artifact FILE --purposes ID,ID --out-dir NEW prepares a local settings editor from the exact final release. It authors ordinary separate choices with explicit wording/channel/revision, preserves optional settings and blocks unresolved or unsupported routes. Try form flow uses real permission controls with temporary memory, explicit saved-state checks and failure/retry scenarios; ordinary submission stays independent. It verifies no host integration. Reuse the authored/catalog build pipeline when present; no release is silently repinned.','For combined ordinary direct forms, use createCollectionFlow from @notabenda/core/content or build --collection-flow FILE (JSON/YAML/Markdown frontmatter). Review and pin reviewedArtifactId, select all notice purposes, and explicitly choose notice-only/separate-permission per purpose. These are separate build settings, not SiteConfig fields; no basis is inferred. Render/hydrate through @notabenda/core/collection/flow with exactly matching host-owned permission controllers.','Place the notice at the actual collection surface with unique instance IDs; retain field-specific instructions and implement submission separately. Notice display records no consent or acceptance.'], questionIds:['personal-data','direct-collection'],factsNeeded:['Actual collection context, selected purposes and data categories','Whether providing data is optional, what a response needs and consequences of omission','Reviewed wording, recipients and retained privacy revision'],guides:['collection','collection-workbench','collection-flow','turkey-processing','localization','releases'],prerequisites:['legal-pages'], verify:['Notice and details remain readable without JavaScript.','Selected facts and language match the retained release.','Field instructions distinguish purpose-level optionality from individual field requirements.','No permission, acceptance, storage or submission handler is created by the notice.','A composed form rejects missing/stale routing decisions; notice-only purposes create no offer, and checking or submitting the primary form creates no permission command.'] }, 'indirect-collection-notice':{ conditionalConfig:[{when:'site-locale-not-english',requiredPaths:['localization.indirectCollection'],reason:'The static indirect notice needs its complete selected dictionary, separate from direct-form messages.'}], requiredConfigPaths:['purposes'], title:'Information collected from another source',outcome:'A static notice for the explicitly assessed supported nz-ipp3a particulars, bound to an exact privacy revision.', configPaths:['purposes','purposes.collection','controller','documents.privacy','localization.indirectCollection'], hostWork:['Assess the supported nz-ipp3a profile explicitly; no profile is selected from a market or locale.','Author createIndirectCollectionNotice inputs: phase advance/collected, exact indirect category subsets, sourceDescription and authority for every collection, recipientStatement, accessCorrection, wording in the site language and reviewStatus.','Bind the reviewed release, render static HTML or plain text, and arrange actual presentation/delivery, timing and any notification evidence separately. This implementation preview is not production-supported jurisdiction coverage.','Supply complete localization.indirectCollection messages for a non-English site. Direct-form localization.collection messages do not translate this separate notice. Keep the actual site language when messages are missing.'], questionIds:['personal-data','indirect-collection'],factsNeeded:['Applicable notification rule and reviewed profile choice','Actual indirect or mixed purposes and exact indirectly collected categories','Source, recipients, authority declaration, collecting/holding agency and access/correction route','Advance/collected phase, language, privacy release and actual notification method/timing'],guides:['indirect-collection','releases'],prerequisites:['legal-pages'], verify:['The notice remains readable without JavaScript and creates no consent, submission or notification-success state.','The privacy link and particulars match the pinned release.','Mixed-source purposes include only the explicit indirect category subsets.','The chosen phase, language and authority/recipient/rights declarations match the actual collection.','The host verifies actual notification, timing and retained presentation/delivery evidence separately.'] }, 'processing-opt-outs':{ title:'Processing opt-outs and browser signals',outcome:'Separate restrictions on declared processing activities.',configPaths:['services.processingActivities','privacySignals','localization.processingChoices','privacy.choicesLink'],hostWork:['For a recorded opt-out, use processing-workbench --artifact FILE --out-dir NEW to author settings from the exact final release. Choose activities, stable workflow scope and all notice wording explicitly. Export JSON/YAML/Markdown frontmatter, then run processing-notice --artifact FILE --settings FILE --out-dir NEW; it works directly with authored/catalog-bound final artifacts. This changes no SiteConfig, signal policy, recording selection or restriction.','Explicitly classify every service with processingActivities, including [] where assessed empty; missing classification remains unresolved.','Choose assessed browser-signal handling and explicit recorded opt-outs separately. Read privacySignalReviews for source-linked Texas, Oregon and Minnesota scope checks, dates and limits; coverage interest enables nothing. Recorded restrictions do not require privacySignals, and browser signals alone require neither login nor a ledger.','For recorded opt-outs, author the exact processing notice and host-bound context/read/submit transports with retained evidence and conservative failure recovery. Non-English notices require complete localization.processingChoices messages; browser signals alone need no opt-out dictionary.','Use createConsent for browser GPC and hasGlobalPrivacyControl(request) plus getPrivacySignalRestrictions(config, {globalPrivacyControl: observed}) at the server boundary before tracking. Connect actual account/downstream restrictions; cookie acceptance and signal absence cannot lift them. The package supplies no reset/re-opt-in flow.','Read privacyInterfaceReviews for California language, path and prominence checks across the complete host flow. If needed, explicitly configure privacy.choicesLink and review homepage placement and the actual destination. California alternative presentation requires the specified title/icon and a destination explaining and enabling both sale/sharing opt-out and sensitive-information limits; the link supplies neither destination coverage nor a substitute for applicable signals.'],questionIds:['processing-opt-outs','browser-opt-out-signals','recorded-processing-opt-outs','downstream-processing'],factsNeeded:['Actual sale/sharing/targeted-advertising flows','Explicit applicability assessment and public explanation','Host identity, durable restriction handling and downstream effects'],guides:['privacy-signals','processing-choices','privacy-choice-links'],prerequisites:['legal-pages'],verify:['Every service has an explicit classification; missing and assessed-empty lists remain distinct.','Applicable observed signals restrict the declared processing; unavailable signals are not fabricated as observed.','Recorded paths handle initial/failed head reads, lost acknowledgments, reload/context changes and concurrent restrictions conservatively.','Cookie acceptance does not remove a separate opt-out.','Confirm actual account and downstream effects, beyond the browser indicator or retained receipt.'] }, 'south-africa-marketing-request':{ title:'South African web marketing request',outcome:'A versioned web request for future email, SMS or WhatsApp marketing, with explicit refusal.', configPaths:['purposes','scopeGuards','localization.formPermission'], questionIds:['personal-data','direct-collection','receipts','children','sensitive-data','high-risk-profiling','regulated-sector'], factsNeeded:['Actual direct/mixed-source purpose and future marketing method','Goods/services, responsible-party facts, complete request/refusal copy and review','Invitation eligibility and wider prior-withholding history','Host context, archived offer, current-state enforcement and external suppression'], hostWork:['Prepare exact-release JSON/YAML/Markdown settings with notabenda marketing-workbench --artifact FILE --purpose ID --out-dir NEW, then compile with notabenda marketing-request --artifact FILE --settings FILE --out-dir NEW. Alternatively use createSouthAfricaMarketingOffer from @notabenda/core/content with profile za-popia-web-request (schema 4). Supply goods/services, email/SMS/WhatsApp method, methodLabel, complete labels, mandatory refusal copy, revision and withdrawal route. These are separate builder settings, not SiteConfig fields. The ordinary form workbench cannot author this specialized profile.','Read marketingRequestReviews for selected source locators, prior-approach/withholding checks and separate engineering advice. Review whether this person may be approached and the prescribed information/accessibility. Preserve invitation and withholding history across sites, channels, identities and contact changes; no invitation counter or customer-exception implementation is supplied.','Archive and activate the exact offer using the updated backend. A changed method needs a separate stable permission; a material request change needs a new revision and activation. Neither resets solicitation history.','Bind actual host identity/context and enforce current server state in sending systems, queues and imports. A historical grant receipt does not authorize current marketing. Message-level duties and external suppression remain host work.'], guides:['south-africa-marketing','marketing-workbench','form-permissions'],prerequisites:['form-permissions'], verify:['Request particulars and responsible-party facts appear before the unchecked choice in the actual language.','Explicit refusal records its own action; silence and ordinary form submission record no permission.','Refusal, withdrawal, failed reads and old-offer retries remain restrictive after activation changes and reload.','Actual downstream systems honor current restrictions and wider withholding; no sending or suppression claim follows from this demo.'] }, 'form-permissions':{ requiredConfigPaths:['scopeGuards'], conditionalConfig:[{when:'site-locale-not-english',requiredPaths:['localization.formPermission'],reason:'The native non-English permission interface needs the complete selected form-permission dictionary.'}], title:'Separate form permissions',outcome:'Optional purpose/channel permission independent of submitting the surrounding form.',configPaths:['purposes','scopeGuards','localization.formPermission'],hostWork:['Create the exact permission offer and implement host context, transport, receipt and withdrawal. Add pinned refusal copy when an explicit negative choice must be recorded; an unchecked field records nothing. For a South African web request, createSouthAfricaMarketingOffer requires goods/services, a supported method, complete labels and refusal copy. Review regional solicitation and suppression rules separately.','Check formPermissionGrantSupported(offer) for the selected purpose. Missing, unknown or present restricted-scope facts keep ordinary grants off; resolve facts or use a separately supported process, never change them to absent to unlock the control.'],questionIds:['personal-data','receipts','children','sensitive-data','high-risk-profiling','regulated-sector'],factsNeeded:['Purpose, channel and optional wording','Action/context identity and durable acknowledgement policy','Supported scope assessment for the actual purpose, including any purpose override'],guides:['form-permissions','south-africa-marketing'],prerequisites:['legal-pages'],verify:['Inspect the actual controller with @notabenda/core/form-permissions/inspect against the complete intended offer and optional host stream. Keep local allowed state, last observed head and historical action receipt separate; publication, backend activation, identity and downstream behavior need separate checks.','Form submission never silently grants permission.','Unchecked/failure states remain off.','Independent withdrawal and reload recovery work.'] }, 'consumer-contracts':{ title:'Consumer purchase and contract flows',outcome:'Selected reviewed pre-purchase disclosures, payment action, confirmations or contract declaration flows.',configPaths:['terms.audience','terms.serviceType','documents.terms','localization.contractActions'],hostWork:['For host-authored contract form and acknowledgement labels, supply the complete localization.contractActions dictionary and all four createContractActionDefinition wording fields in the selected site language. The profile selects mechanics; language never establishes applicability. Keep prior definitions for uncertain retries.','Review each applicable flow separately: host quotes, payment/fulfillment, confirmations, withdrawal/cancellation, guarantees and delivery jobs are distinct.'],questionIds:['consumer-payments','consumer-distance-contracts','consumer-continuing-contracts','receipts'],factsNeeded:['Actual goods/services/digital content and consumer audience','How/where a contract forms, price/renewal obligations and applicable exclusions/windows','Required customer documents, delivery destination and independent host jobs'],guides:['paid-orders','order-confirmations','contract-actions','contract-dispatch','guarantees','guarantee-labels'],prerequisites:['legal-pages'],verify:['Final price/commitment and action match the host’s exact offer.','Receipt/storage is not presented as payment, recipient delivery or contract fulfillment.','Test each selected flow and its host handoff separately.'] }, "contract-withdrawal":{"title":"Consumer contract withdrawal","outcome":"A deliberate withdrawal declaration bound to reviewed disclosures, with separate acknowledgment and application handoffs.","configPaths":["terms.audience","terms.serviceType","documents.terms","documents.privacy","localization.contractActions"],"questionIds":["consumer-distance-contracts","contract-public-entry"],"factsNeeded":["Assessed de-withdrawal, eu-withdrawal or br-withdrawal profile, scope, exclusions and actual rights window","Public entry point and admitted operation identity","Exact definition/revision and independent acknowledgment/application delivery policy"],"guides":["consumer-packs","contract-actions","contract-dispatch","releases","localization"],"prerequisites":["legal-pages"],"hostWork":["Choose the withdrawal profile after assessing the actual contract. Built-in v1 labels keep their original profile language. For custom interface copy, supply the complete localization.contractActions dictionary and all four definition wording fields; v2 binds them to the site language.","Author createContractActionDefinition against the exact reviewed release; mount createContractAction outside another form with admitted context and real transport. These are builder/host inputs, not invented SiteConfig fields.","Supply the public route without mandatory login, cookie consent or privacy acceptance. Wire acknowledgment and application independently with idempotency, scheduling and monitoring."],"verify":["Details review precedes the deliberate final action; initial rendering makes no request.","Lost acknowledgments preserve the exact request for retry; a receipt does not establish a refund or delivery.","Acknowledgment dispatch continues when contract matching or application fails.","The real public entry route remains usable on mobile and keyboard without a prior cookie choice.","Custom selected copy matches the archived site language and direction, while old uncertain requests and acknowledgement bytes survive later copy revisions."]}, "subscription-cancellation":{"title":"German continuing-contract cancellation","outcome":"The supported de-cancellation declaration with a direct final action and savable exact request.","configPaths":["terms.audience","terms.serviceType","documents.terms","documents.privacy","localization.contractActions"],"questionIds":["consumer-continuing-contracts","contract-public-entry"],"factsNeeded":["Paid continuing contract, online conclusion and assessed scope/exclusions","Actual public entry route and supported German interface","Cancellation fields, admitted context and independent delivery jobs"],"guides":["consumer-packs","contract-actions","contract-dispatch","localization"],"prerequisites":["legal-pages"],"hostWork":["Assess de-cancellation explicitly; other subscription regimes are not inferred. Keep reviewed statutory action wording. For custom interface copy, supply complete localization.contractActions messages and all four definition wording fields; language does not change profile mechanics.","Author and register the exact contract definition. Mount the final action on its confirmation page; do not insert the withdrawal review step.","Preserve ordinary/extraordinary type, optional reason and requested ending. Blank means earliest possible; the package calculates no termination date. Connect independent acknowledgment/application and actual public entry without login or cookie permission."],"verify":["Final action is available directly on the confirmation page.","The exact declaration and requested ending survive retry, receipt and download.","Receipt never claims the contract ended; acknowledgment is independent of contract matching.","The route and fields work on narrow screens, with keyboard and without prior cookie permission.","Custom selected copy matches the archived site language and direction, while old uncertain requests and acknowledgement bytes survive later copy revisions."]}, "paid-order-review":{"title":"Paid order review and final action","outcome":"Exact item, price and commitment information beside an explicit payment-obligation action.","configPaths":["terms.audience","terms.serviceType"],"questionIds":["consumer-payments","consumer-goods","consumer-digital-content","consumer-variable-charges"],"factsNeeded":["Assessed eu-paid-distance-order-v1 profile and actual goods/services/digital-content mix","Per-item characteristics, commitments and reviewed guarantee branch for every good","Host quote ownership, quantities, fixed/calculated/recurring/deferred/conditional charges","Actual payment/formation behavior, atomic admission and recovery"],"guides":["consumer-packs","paid-orders","guarantee-labels"],"prerequisites":[],"hostWork":["Use @notabenda/authoring/orders for createPaidOrderDefinition/createPaidOrderReview and @notabenda/core/orders for rendering/action. Definitions and quotes are separate builder inputs, not SiteConfig fields.","Bind live host-owned quotes to reviewed wording, exact items, full price calculations and original label files. Missing guarantee facts cannot mean no-label-required.","Implement atomic admission per checkout intent and exact recovery before expiry rejection. The host owns payment, contract formation and fulfillment; receiving an action does not execute them."],"verify":["All required facts and complete applicable label images precede dispatch and remain readable at narrow widths.","Stale or mismatched quotes cannot execute; one checkout intent has at most one admission across nonces/revisions.","Lost-response recovery resolves an admitted attempt before expiry is considered.","The payment action, quantities and calculations match the actual offer; received never means paid."]}, "customer-confirmations":{"title":"Customer copies and confirmation delivery","outcome":"Retained personally addressed customer files with a fixed, independently tracked delivery handoff.","configPaths":["terms.audience","terms.serviceType"],"questionIds":["customer-copy-delivery","order-admission-archive","consumer-digital-content"],"factsNeeded":["Actual contract conclusion and complete personally addressed copy/attachments","Existing received Cloudflare order admission plus retained review in the same checkout context","Digital-content evidence or explicit non-applicability reason","Fixed destination/version, provider idempotency, scheduling and operational policy"],"guides":["consumer-packs","order-confirmations","paid-orders"],"prerequisites":[],"hostWork":["Inspect or integrate the existing @notabenda/cloudflare/orders admission/archive foundation. preparePaidOrderConfirmation requires its received event and retained review in the same checkout context; arbitrary external receipts are unsupported. Do not manufacture historic admissions or automatically replace the checkout UI.","Prepare the complete personally addressed copy and exact attachments after actual contract conclusion. Keep files/destination/version fixed; a receipt or links to policies cannot replace the customer copy.","Connect the provider with authorization, admission, idempotency, scheduling, reconciliation and retention. Independently selecting this pack does not remove the backend foundation requirement."],"verify":["Missing required files, invalid bindings and unsupported admissions are rejected. The host separately reviews the customer copy’s completeness and readability.","Exact files and fixed destination survive restart and retry.","Provider acceptance remains distinct from recipient delivery; uncertain settlement and stale leases stay visible.","Digital-content evidence or reviewed non-applicability is retained with the actual copy."]}, "guarantee-information":{"title":"Shop notices and producer guarantee labels","outcome":"Separately assessed shop legal-guarantee information and product-specific finished producer labels.","configPaths":[],"questionIds":["consumer-goods","shop-guarantee-notice","producer-guarantee-labels"],"factsNeeded":["Assessed shop notice applicability, selected supported language and actual placement","Exact product/model, producer, duration and all four qualification facts for each label","Original finished producer file, language, readable alternatives, QR destination and source/artwork review"],"guides":["consumer-packs","guarantees","guarantee-labels","guarantee-producer-example"],"prerequisites":[],"hostWork":["Choose the shop notice and product-label branches separately after review; this pack enables neither from a market or locale. A shop legal guarantee is not a producer commercial guarantee.","For shop notices use buildLegalGuaranteeNotice, select its supported language and supply surrounding labels outside English. Review source discrepancy and extracted text as documented; publish unchanged emitted files.","For labels use @notabenda/authoring/guarantees with finished producer artwork, exact product/model, duration and offeredByProducer/noAdditionalCost/coversEntireGood/informationProvidedToTrader. Missing or false facts do not establish that no label is required.","Retain original files, readable alternatives and proper product placement. Structural image validation is not artwork authentication or legal approval."],"verify":["Source/label hashes match the original complete artwork and older files remain available.","The label is associated with the correct product and actual guarantee; all qualification facts have supporting evidence.","Full artwork, alternatives, language and QR links are readable/usable in the actual mobile and desktop placement.","Neither display creates consent, agreement, payment or delivery behavior."]}, 'evidence':{ title:'Durable evidence and backoffice',outcome:'Host-authorized archives and inspection of retained records.',configPaths:[],hostWork:['Optional @notabenda/cloudflare storage/admin, or the host’s compatible recording integration.','Implement authorization, fixed site/object scope, recording admission, identity, activation, retention, holds/erasure and private source/export grants.','For the read-only recording inspector, supply fixed expected descriptor ID, artifact ID and mode from the intended application build. Compare its current backend selection, review inactive/mismatched results and keep current/expected archive links separate. Never infer activation or fix it automatically from a match.'],questionIds:['receipts'],factsNeeded:['Which records must be retained and why','Host authorization/identity and storage architecture','Retention, access and operational policy'],guides:['cloudflare-starter','cloudflare','consent-evidence','releases','evidence-lifecycle','recording-inspection'],prerequisites:['legal-pages'],verify:['Unauthorized access is denied before storage access.','Records bind exact retained releases.','Inspect the selected backend notice/offer against its retained archive. An optional fixed publication reader can compare the pinned HTML bytes on an explicit operator request; an asset binding does not verify public HTTP routing, service enforcement or personal permission.','Private source/export needs separately granted authority.','Restart, retry and retention behavior match the host policy.'] }, 'localization':{ requiredConfigPaths:['localization'], title:'Localized wording',outcome:'Explicit host-supplied document/control wording and formatting.',configPaths:['site.locale','localization'],hostWork:['Supply complete reviewed message dictionaries and revision bindings; test direction and layout.'],questionIds:[],factsNeeded:['Languages, complete wording and translation review','Message/disclosure revisions and any terms statement'],guides:['localization'],prerequisites:['legal-pages'],verify:['No unintended language fallback.','Keyboard, long text and writing direction remain usable.','Language selection does not activate regional policies.'] }, 'regional-consent':{ title:'Explicit regional consent timing',outcome:'Individually reviewed opt-in timing policies within documented coverage.',configPaths:['jurisdictions','consent.promptPolicy','consent.grantExpiryPolicy','consent.grantLifetimeDays','consent.refusalLifetimeDays'],hostWork:['Assess applicability and each supported requirement; select only the policy actually needed.'],questionIds:['optional-storage'],factsNeeded:['Actual jurisdiction/applicability decision','Separate grant expiry, refusal memory and repeat-prompt requirements','Material processing revisions and any supported change explanation'],guides:['regional-prompts','requirements'],prerequisites:['cookie-consent'],verify:['Policy selection is explicit.','Boundary/return-visit behavior follows the selected policy.','Permission expiry, repeat solicitation and evidence retention use separate clocks.'] }, 'discovery':{ title:'Optional service discovery',outcome:'Private candidates and coverage limits for operator review.',configPaths:[],hostWork:['Deliberately select project scanning and/or authorized browser observations.'],questionIds:[],factsNeeded:['Directory/scenario authorized for inspection','Actual use and provider facts for each accepted candidate'],guides:['discovery','service-catalog'],prerequisites:[],verify:['No project modules/scripts or vendor probes execute.','Findings do not alter inventory or permissions.','Review skipped channels and files; an empty report proves no absence.'] } }; /** Scope questions describe requested work, never regulatory applicability. */ const selectionQuestions=[ {id:'documents',targetId:'legal-pages',question:'Do you want to add or update static privacy, cookie or terms documents?'}, {id:'authored-sources',targetId:'authored-documents',question:'Do you want to maintain documents as Markdown or trusted MDX with frontmatter?'}, {id:'optional-service-control',targetId:'cookie-consent',question:'Do you want consent-based controls for optional scripts or browser storage?'}, {id:'assessed-storage-exceptions',targetId:'storage-exceptions',question:'Do you want separate objection settings for an explicitly assessed supported storage-exception profile?'}, {id:'technology-notice',targetId:'technology-functions',question:'Do you want to disclose identification, location or profiling technology and explain its voluntary activation?'}, {"id":"google-basic-connection","targetId":"google-basic","question":"Do you want supported Google Basic tags gated by the existing consent controller?"}, {id:'remote-media',targetId:'embeds',question:'Do you want remote media to stay unloaded until its service is permitted?'}, {id:'explicit-agreement',targetId:'terms-agreement',question:'Do you want an explicit acceptance action bound to an exact terms revision?'}, {id:'rights-entry',targetId:'privacy-rights',question:'Do you want a page linking visitors to your privacy request workflows?'}, {id:'collection-surface',targetId:'collection-notice',question:'Do you want static privacy information beside a form where people provide data?'}, {id:'indirect-collection-surface',targetId:'indirect-collection-notice',question:'Do you want a separate supported notice about information received from another source?'}, {id:'processing-restrictions',targetId:'processing-opt-outs',question:'Do you want separate processing opt-outs or browser privacy signals connected to host restrictions?'}, {id:'za-marketing-request',targetId:'south-africa-marketing-request',question:'Do you want the supported South African web request for future email, SMS or WhatsApp marketing?'}, {id:'form-permission',targetId:'form-permissions',question:'Do you want optional purpose/channel permission separate from submitting a form?'}, {id:'purchase-contract',targetId:'consumer-contracts',question:'Do you want consumer purchase or contract disclosures and action flows?'}, {"id":"withdrawal-route","targetId":"contract-withdrawal","question":"Do you want a supported contract withdrawal declaration route?"}, {"id":"cancellation-route","targetId":"subscription-cancellation","question":"Do you want the supported German continuing-contract cancellation route?"}, {"id":"paid-order-action","targetId":"paid-order-review","question":"Do you want an exact paid-order review and final payment-obligation action?"}, {"id":"customer-copy","targetId":"customer-confirmations","question":"Do you want retained customer copies and their real delivery handoff?"}, {"id":"guarantee-displays","targetId":"guarantee-information","question":"Do you want to assess shop guarantee information or product-specific producer labels?"}, {id:'stored-evidence',targetId:'evidence',question:'Do you want durable records, retained archives or an operator backoffice?'}, {id:'translated-copy',targetId:'localization',question:'Do you want documents or controls in additional languages?'}, {id:'regional-timing',targetId:'regional-consent',question:'Do you want to assess and configure an explicit supported regional consent timing policy?'}, {id:'service-investigation',targetId:'discovery',question:'Do you want optional project scanning or review of authorized browser observations?'} ]; /** Read-only reference. Targets describe requested work; they never activate it. */ export function describeIntegration(requested:readonly string[]=[]){ if(!Array.isArray(requested)||requested.length>32||Array.from(requested).some(id=>typeof id!=='string'||!Object.hasOwn(targets,id)))throw Error('Unknown integration target. Run notabenda describe to list supported targets.'); return integrationReference(requested.length?[...new Set(requested)]:Object.keys(targets)); } function integrationReference(selected:string[]){ const resolved=new Set(); function include(id:string){if(resolved.has(id))return;for(const prior of targets[id]!.prerequisites)include(prior);resolved.add(id);} for(const id of selected)include(id); const relevantQuestionIds=[...new Set([...resolved].flatMap(id=>targets[id]!.questionIds))]; return structuredClone({schemaVersion:1,kind:'notabenda-integration-reference',requestedTargetIds:selected, boundaries:{advisoryOnly:true,writesFiles:false,readsProject:false,activatesFeatures:false,legalReview:false}, configContract:{schemaVersion:1,typeExport:'@notabenda/core',typeName:'SiteConfig',schema:{command:'notabenda schema [PATH] --json',packageExport:'@notabenda/core/config/schema.json',website:'https://notabenda.org/site-config.schema.json',purpose:'Generated authoring shape: exact known keys, required fields and allowed type values. Field lookup follows array items. Always run check for runtime and review rules; shape supplies no defaults or facts.'},validation:'notabenda check --config FILE --json',validationUsesAuthoringShape:true,sourceFormats:['json','yaml','markdown'],sourceExtensions:['.json','.yaml','.yml','.md'],sourceReader:'@notabenda/core/config/node',browserCodec:'@notabenda/core/config/document',wizardOutputFormat:'--config-format json|yaml|markdown',consentRuntimeBuild:{option:'--consent-runtime local|required',descriptor:'consent-runtime.json',stylesheet:'assets/notabenda-consent.css',browserEntry:'@notabenda/core/consent',primaryFactory:'createConsent',acceptedInput:'ConsentRuntimeConfig',fullSiteInputAccepted:false,compilerEntry:'@notabenda/core/content',compilerFactory:'compileConsentRuntimeConfig',compilerRunsIn:'build-or-ssr',requiredAdapterEntry:'@notabenda/core/consent/evidence',requiredAdapterFactory:'requiredConsentEvidence',controllerInventory:'ConsentRuntimeInventory',compatibilityEntry:'@notabenda/core/consent/compat',guide:'browser-config',evidenceModeHasNoDefault:true,hostConnectionRequired:true,noticeScopeOption:'--consent-scope SLUG',noticeAlias:'consent-notice.json',pinnedNotice:'artifacts/{artifactId}/consent/{noticeId}.json',retainedNoticeOption:'--retain-consent-notice FILE',retainedNoticeNeedsLegalRelease:true,nativeNoticeWording:true},authoringValidator:'@notabenda/core/config/validate',jsonCli:true,markdownMdx:'@notabenda/authoring build API',hostWorkIsNotConfig:true,starterDefaultsAreNotFacts:true,pathNotation:'Dot paths through inventory arrays refer to each item field, not literal JSON keys.'}, assessment:{command:'notabenda assess --selection FILE --config FILE --json',optionalAnswers:'--answers FILE',api:'@notabenda/core/integration/assessment',readOnly:true,meaning:'Checks explicit config and practice answers against selected work. Declared fields are not verified facts; host work and review remain separate.'}, selectionQuestions, selectionTemplate:{schemaVersion:1,answers:Object.fromEntries(selectionQuestions.map(q=>[q.id,'unknown']))}, publicFactFields:setupFactFields.map(([id,label])=>({id,label})), relevantQuestionIds, targets:[...resolved].map(id=>({id,selection:selected.includes(id)?'requested':'prerequisite',...targets[id]!,guides:targets[id]!.guides.map(slug=>'https://notabenda.org/guide/'+slug+'/index.md')})), questions:setupQuestions.map(q=>({id:q.id,title:q.title,detail:q.detail,choices:['yes','no','unknown'],configPaths:q.paths.filter(p=>!p.startsWith('host.')),hostWorkRefs:q.paths.filter(p=>p.startsWith('host.')),requirementIds:q.requirements,guide:'https://notabenda.org/guide/'+q.guide+'/index.md'})), markets:setupMarkets, privacySignalReviews:getPrivacySignalReviews(), privacyInterfaceReviews:getPrivacyInterfaceReviews(), cookieJurisdictionReviews:getCookieJurisdictionReviews(), marketingRequestReviews:getMarketingRequestReviews(), answersTemplate:{schemaVersion:1,publicFacts:{},markets:[],answers:Object.fromEntries(setupQuestions.map(q=>[q.id,{choice:'unknown',justification:''}])),storageJustifications:{}}, targetAnswersTemplate:{schemaVersion:1,publicFacts:{},markets:[],answers:Object.fromEntries(relevantQuestionIds.map(id=>[id,{choice:'unknown',justification:''}])),storageJustifications:{}}, workflow:['Record requested outcomes and existing integration points.','Separate confirmed facts, project evidence, unknowns and legal review decisions.','Read target guides and the installed SiteConfig type; host work is not a JSON config field.','Complete explicit answers and run wizard --answers FILE, adding --config FILE for an existing inventory.','Compare the exported draft against the original; apply only reviewed changes.','Run check/build in preview, integration scenarios, and production validation when review is complete.'], handoffFields:['requested outcomes','selected target IDs','existing integration','confirmed facts and provenance','unknown facts and consequences','exact config changes','host/build/runtime work','review and deployment status','verification results'] }); } /** Resolve explicit scope decisions only; an unanswered question is never a grant or a negative answer. */ export function selectIntegration(input:unknown){ const fail=():never=>{throw Error('Invalid integration selection. Use selectionTemplate from notabenda describe --json; answers must be yes, no or unknown.');}; const data=(value:unknown,allowed:string[])=>{ if(!value||typeof value!=='object'||Array.isArray(value))return fail(); const proto=Object.getPrototypeOf(value);if(proto!==null&&proto!==Object.prototype)return fail(); const out:Record=Object.create(null); for(const key of Reflect.ownKeys(value)){ if(typeof key!=='string'||!allowed.includes(key))return fail(); const descriptor=Object.getOwnPropertyDescriptor(value,key)!; if(!descriptor.enumerable||!Object.hasOwn(descriptor,'value'))return fail();out[key]=descriptor.value; } return out; }; const root=data(input,['schemaVersion','answers']);if(root.schemaVersion!==1)return fail(); const answers=data(root.answers,selectionQuestions.map(q=>q.id)); const decisions=selectionQuestions.map(q=>{ const choice=Object.hasOwn(answers,q.id)?answers[q.id]:'unknown'; if(choice!=='yes'&&choice!=='no'&&choice!=='unknown')return fail(); return {...q,choice}; }); const selected=decisions.filter(q=>q.choice==='yes').map(q=>q.targetId),reference=integrationReference(selected); return { schemaVersion:1,kind:'notabenda-integration-selection', decisions,unresolvedQuestionIds:decisions.filter(q=>q.choice==='unknown').map(q=>q.id), requestedTargetIds:selected, prerequisiteTargetIds:reference.targets.filter(t=>t.selection==='prerequisite').map(t=>t.id), prerequisiteReview:reference.targets.filter(t=>t.selection==='prerequisite').map(t=>({targetId:t.id,questionId:decisions.find(q=>q.targetId===t.id)!.id,scopeChoice:decisions.find(q=>q.targetId===t.id)!.choice,action:'Check existing supporting configuration and documents before adding work. A prerequisite is not an additional requested feature.'})), status:decisions.some(q=>q.choice==='unknown')?'scope-incomplete':'scope-recorded', productionReady:false,reference }; }