@topy-ai/maggie 0.7.48 → 0.7.49

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.
Files changed (49) hide show
  1. package/README-zh-TW.md +2 -2
  2. package/README.md +31 -4
  3. package/bin/maggie.js +17 -4
  4. package/bundled-contracts/google-integrations/capability-report-v2.schema.json +2 -1
  5. package/bundled-contracts/maggie-content/email-localization-v1.schema.json +89 -0
  6. package/bundled-contracts/maggie-content/lifecycle-email-v1.schema.json +76 -0
  7. package/bundled-contracts/maggie-deployment/readiness-v1.schema.json +6 -1
  8. package/bundled-contracts/maggie-ops/marketing-run-v1.schema.json +89 -0
  9. package/bundled-contracts/maggie-ops/notification-catalogue-example-v1.json +941 -0
  10. package/bundled-contracts/maggie-ops/notification-catalogue-v1.schema.json +273 -0
  11. package/bundled-contracts/maggie-service-booking/fact-provenance-v1.schema.json +128 -0
  12. package/bundled-contracts/maggie-service-booking/import-stages-v1.schema.json +191 -0
  13. package/bundled-references/google-integrations-runbook.md +54 -0
  14. package/bundled-skills/maggie-content-localization/SKILL.md +17 -1
  15. package/bundled-skills/maggie-content-localization/references/email-and-lifecycle.md +83 -0
  16. package/bundled-skills/maggie-deployment/SKILL.md +89 -7
  17. package/bundled-skills/maggie-deployment/references/vps.md +38 -6
  18. package/bundled-skills/maggie-design/SKILL.md +55 -0
  19. package/bundled-skills/maggie-feedback/SKILL.md +29 -0
  20. package/bundled-skills/maggie-ops/SKILL.md +37 -0
  21. package/bundled-skills/maggie-ops/references/notifications-operations.md +154 -0
  22. package/bundled-skills/maggie-service-booking/SKILL.md +59 -0
  23. package/bundled-skills/maggie-social-share/SKILL.md +19 -2
  24. package/bundled-skills/maggie-social-share/references/marketing-run.md +57 -0
  25. package/bundled-skills/maggie-social-share/references/queue-and-connections.md +51 -0
  26. package/bundled-tools/clis/maggie_deployment.py +58 -17
  27. package/bundled-tools/clis/maggie_deployment_auth_canary.py +216 -0
  28. package/bundled-tools/clis/maggie_deployment_collect.py +225 -0
  29. package/bundled-tools/clis/maggie_deployment_readiness.py +53 -3
  30. package/bundled-tools/clis/maggie_design.py +8 -0
  31. package/bundled-tools/clis/maggie_design_verify.py +359 -0
  32. package/bundled-tools/clis/maggie_docs.py +82 -4
  33. package/bundled-tools/clis/maggie_email_localization.py +382 -0
  34. package/bundled-tools/clis/maggie_feedback.py +9 -2
  35. package/bundled-tools/clis/maggie_icon_glyph_check.py +382 -0
  36. package/bundled-tools/clis/maggie_icon_release_gate.py +28 -1
  37. package/bundled-tools/clis/maggie_localization.py +5 -0
  38. package/bundled-tools/clis/maggie_marketing_run.py +272 -0
  39. package/bundled-tools/clis/maggie_notifications.py +528 -0
  40. package/bundled-tools/clis/maggie_ops.py +87 -0
  41. package/bundled-tools/clis/maggie_schedule.py +12 -2
  42. package/bundled-tools/clis/maggie_service_import.py +520 -0
  43. package/bundled-tools/clis/maggie_social_queue.py +104 -0
  44. package/bundled-tools/clis/maggie_social_share.py +6 -2
  45. package/bundled-tools/runtime/google_ads.py +306 -0
  46. package/bundled-tools/runtime/google_capabilities.py +18 -2
  47. package/bundled-tools/runtime/google_remediation.py +152 -0
  48. package/package.json +1 -1
  49. package/references/google-integrations-runbook.md +54 -0
package/README-zh-TW.md CHANGED
@@ -29,7 +29,7 @@ npx @topy-ai/maggie init --scope project --agent all
29
29
  npx @topy-ai/maggie doctor --scope project --project .
30
30
  ```
31
31
 
32
- 目前 npm 版本為 `0.7.48`,處理 2026-10-10 的 27 條 hosted feedback(batch 26):Social Share 新增 `adapters`(每個 provider 一組 canonical OAuth scope,LinkedIn 不同 scope 會撤銷舊 token;共用 OAuth client 警告)、`connections`(撤銷或無法解密的 token 標為 `needs_reconnect`,偵測會過期的簽名頭像 URL)、`queue`(slot-based 排程:not-before、最新優先、campaign 輪流與每日上限、DST-safe)與 `campaigns`(idea stage Start gate);Deployment 新增 hash-only `secret-fingerprint`/`secret-parity`、`env-isolation`(本機 `.env` 指向 production database 時警告)、release retention 與 worker-before-enqueue 發布順序;QA 在未明確同意時阻擋對 production API 的寫入情境,並以 `maggie qa cors-preflight` 只用 OPTIONS 檢查每個 HTTP method;Design 新增 `pressable-check`、`layer-check`(Tailwind v4 unlayered CSS)、onboarding wizard/picker 模式與 `maggie-palette-roles-v1` palette generate/validate;Marketplace 加入 screenshot 完整性與像素預算、從 CSS 量測 palette、asset provenance、中性 `displayName`(全部模板已補齊)、template studio、`maggie-template-content-v1` 合約與圖片生成成本/無文字審查 gate;Booking 新增唯讀 Stripe live setup runbook 與 gift voucher lifecycle 合約(`maggie booking voucher-contract --ledger`);Feedback 新增 `improvement` 類型與 `maggie feedback session-summary`。MaggieDash 0.2.11 會保留尚未部署 template 的 outbox email 而不是 dead-letter,並從 ORA host 上游通用修正。本版也包含 Booking 十個 email events 合約與 CLI validator 同步及安全輸出的 `arrivalNote`。前一版 `0.7.47` 處理 2026-09-26 五條新 feedback:project-scope
32
+ 目前 npm 版本為 `0.7.49`,完成 batch 27:33 條 2026-09-09 至 09-16 建立但從未提交的本機 feedback drafts,已逐條對照目前程式碼(其中兩條已被既有功能滿足)。新增離線 `maggie ops notifications`(通知 catalogue 合約、consent/retention/durable lead delivery 規則、provider template drift、只檢查變數名稱的 Resend preflight、queue health 門檻與 operator alerts、dry-run retention plan);`maggie localization email-matrix` 與 `maggie localization lifecycle`(locale 優先順序、未翻譯/缺漏 locale、變數與 HTML/text 一致、market CTA route、consent-aware 行銷 email 預設不發送);Deployment 的 `--keep-releases` 統一 retention policy、`auth-canary`、資料庫 owner 無法讀取 release 路徑時的 streamed migration、`collect` 單一 readiness report;Google failure remediation(`maggie ops google-diagnose`)與唯讀 `google-ads-preflight`/`google-ads-keyword-ideas`;Social Share `reconcile`(timeout 後不重複發文)、`maggie-marketing-run-v1` 合約、命名排程層與只管制對外發布的 regulated-content review;`maggie design icon-glyph-check`、`maggie design verify`、`maggie service import-stages-validate`/`import-readiness`/`fact-provenance`;以及 `--release-metadata` 版本一致性檢查、`maggie docs rollout-status` 與 stdin batch 輸入。前一版 `0.7.48` 處理 2026-10-10 的 27 條 hosted feedback(batch 26):Social Share 新增 `adapters`(每個 provider 一組 canonical OAuth scope,LinkedIn 不同 scope 會撤銷舊 token;共用 OAuth client 警告)、`connections`(撤銷或無法解密的 token 標為 `needs_reconnect`,偵測會過期的簽名頭像 URL)、`queue`(slot-based 排程:not-before、最新優先、campaign 輪流與每日上限、DST-safe)與 `campaigns`(idea stage Start gate);Deployment 新增 hash-only `secret-fingerprint`/`secret-parity`、`env-isolation`(本機 `.env` 指向 production database 時警告)、release retention 與 worker-before-enqueue 發布順序;QA 在未明確同意時阻擋對 production API 的寫入情境,並以 `maggie qa cors-preflight` 只用 OPTIONS 檢查每個 HTTP method;Design 新增 `pressable-check`、`layer-check`(Tailwind v4 unlayered CSS)、onboarding wizard/picker 模式與 `maggie-palette-roles-v1` palette generate/validate;Marketplace 加入 screenshot 完整性與像素預算、從 CSS 量測 palette、asset provenance、中性 `displayName`(全部模板已補齊)、template studio、`maggie-template-content-v1` 合約與圖片生成成本/無文字審查 gate;Booking 新增唯讀 Stripe live setup runbook 與 gift voucher lifecycle 合約(`maggie booking voucher-contract --ledger`);Feedback 新增 `improvement` 類型與 `maggie feedback session-summary`。MaggieDash 0.2.11 會保留尚未部署 template 的 outbox email 而不是 dead-letter,並從 ORA host 上游通用修正。本版也包含 Booking 十個 email events 合約與 CLI validator 同步及安全輸出的 `arrivalNote`。前一版 `0.7.47` 處理 2026-09-26 五條新 feedback:project-scope
33
33
  `maggie init` 會建立本地 memory store;context 預設只讀取本 project scope;memory hook
34
34
  在 local Python adapter 不存在時 fallback 到已安裝 CLI;重複 init 保留既有檔案與時間戳;
35
35
  `maggie feedback list` 的 `--project` 可放在子命令前或後。Generated VPS runner 現在記錄
@@ -113,7 +113,7 @@ structure drift 或重複 treatment product 時 fail closed。
113
113
  deployment、memory、feedback 和 MaggieDash。內容先 draft/review,外部寫入、
114
114
  publish 與 production deployment 需要明確確認。
115
115
 
116
- 目前 npm 版本為 `0.7.48`,包含 batch 26 feedback 修正與 Booking email-template 合約/CLI validator 同步。本版完成 2026-09-24 booking feedback batch:Calendar grid/free-slot entry 與 host modal focus-restoration evidence。本版新增 Starter marketplace provisioning plan;本版完成 feedback batches 22、23:加入 declarative browser interaction evidence、design markup/style/content-key gate、compiler source anchoring、entity double-escape protection、`update --help` read-only、noindex hypothetical indexability、可過期 baseline acknowledgement、DOM-only link extraction regression,以及 MaggieDash 0.2.10 的 content override、短期 browser session、CDN-safe public-session cache contracts。authentication 和 isolated dev server 仍由 host 負責。`maggie-booking` workflow、傳統 email/password、Stripe、Resend、public booking flow 及既有安全邊界維持不變;provider-bound video generation 與 transactional delivery 仍記錄在 issue #39,前一批延後功能仍在 issue #38,不會直接成為 active memory。0.7.33 記錄並審查一筆更正回饋;確認 0.7.32 已正確處理 batch index,沒有修改已驗證的 shared behavior。0.7.32 加入 feedback 一基索引支援、MaggieDash panel 的 source/freshness/error evidence、Consent Mode 與實際 write/no-op reconciliation、SEO baseline recapture、sitemap origin rebasing、content-diff scope、migration ledger reconciliation、deployment credential preflight、release provenance/runtime preflight、icon release gate、opt-in blog auto-publish gate,以及 least-privilege VPS deployer。也修復 top-level `maggie feedback` dispatcher parity。0.7.31 加入 update 差異摘要、atomic installer copy、subset install manifest merge,以及 inventory drift 時 doctor non-zero。0.7.30 補上 feedback tracking issue closeout gate 與 batch 14/15 audit ledger。0.7.29 修正 npm package landing page 使用英文 README;0.7.28 加入 versioned Gemini model policy、明確 fallback 與 provenance、bundled-first CLI
116
+ 目前 npm 版本為 `0.7.49`,包含 batch 26、27 feedback 修正與 Booking email-template 合約/CLI validator 同步。本版完成 2026-09-24 booking feedback batch:Calendar grid/free-slot entry 與 host modal focus-restoration evidence。本版新增 Starter marketplace provisioning plan;本版完成 feedback batches 22、23:加入 declarative browser interaction evidence、design markup/style/content-key gate、compiler source anchoring、entity double-escape protection、`update --help` read-only、noindex hypothetical indexability、可過期 baseline acknowledgement、DOM-only link extraction regression,以及 MaggieDash 0.2.10 的 content override、短期 browser session、CDN-safe public-session cache contracts。authentication 和 isolated dev server 仍由 host 負責。`maggie-booking` workflow、傳統 email/password、Stripe、Resend、public booking flow 及既有安全邊界維持不變;provider-bound video generation 與 transactional delivery 仍記錄在 issue #39,前一批延後功能仍在 issue #38,不會直接成為 active memory。0.7.33 記錄並審查一筆更正回饋;確認 0.7.32 已正確處理 batch index,沒有修改已驗證的 shared behavior。0.7.32 加入 feedback 一基索引支援、MaggieDash panel 的 source/freshness/error evidence、Consent Mode 與實際 write/no-op reconciliation、SEO baseline recapture、sitemap origin rebasing、content-diff scope、migration ledger reconciliation、deployment credential preflight、release provenance/runtime preflight、icon release gate、opt-in blog auto-publish gate,以及 least-privilege VPS deployer。也修復 top-level `maggie feedback` dispatcher parity。0.7.31 加入 update 差異摘要、atomic installer copy、subset install manifest merge,以及 inventory drift 時 doctor non-zero。0.7.30 補上 feedback tracking issue closeout gate 與 batch 14/15 audit ledger。0.7.29 修正 npm package landing page 使用英文 README;0.7.28 加入 versioned Gemini model policy、明確 fallback 與 provenance、bundled-first CLI
117
117
  dispatch、`maggie --version`、feedback batch review 聚合與重複偵測、marketplace enrichment evidence、booking
118
118
  worker/resolver evidence,以及 read-only migration preflight。它也包含 host-owned mobile app surface contract、signed-in
119
119
  camera-state QA、直接 Astro route resolution、correlated feedback batch,以及
package/README.md CHANGED
@@ -89,8 +89,35 @@ Maggie keeps the existing project foundation and asks for decisions before
89
89
  shared routes, analytics, or publishing boundaries change. The current
90
90
  package ships 20 installable skills and a local-first MaggieDash foundation.
91
91
 
92
- This package is `0.7.48`. It processes the 27 hosted feedback
93
- records of 2026-10-10 (batch 26) and includes the Booking email-template
92
+ This package is `0.7.49`. It closes batch 27: 33 local feedback
93
+ drafts from 2026-09-09 to 09-16 that were never submitted, reconciled against
94
+ the current code (two were already satisfied):
95
+
96
+ - Notifications: offline `maggie ops notifications` — catalogue contract with
97
+ consent, retention and durable lead-delivery rules, template drift against
98
+ paginated provider exports, Resend preflight by variable name, queue health
99
+ thresholds with operator alerts, and a dry-run retention plan.
100
+ - Email localization: `maggie localization email-matrix` (locale precedence,
101
+ untranslated/missing locales, variable and HTML/text parity, market CTA
102
+ routes) and `maggie localization lifecycle` (consent-aware marketing email
103
+ with a no-send default until approved).
104
+ - Deployment: one `--keep-releases` retention policy shared by plan, runner,
105
+ preflight and rollback evidence; `auth-canary` for role-scoped
106
+ authenticated API probes; streamed migrations for a database owner that
107
+ cannot read the release path; `collect` for one readiness report.
108
+ - Google: failure remediation (`maggie ops google-diagnose`) and read-only
109
+ `google-ads-preflight` / `google-ads-keyword-ideas`.
110
+ - Marketing: Social Share `reconcile` (no duplicate post after a timeout), the
111
+ `maggie-marketing-run-v1` contract, named schedule layers, and opt-in
112
+ regulated-content review that gates only external publication.
113
+ - Design and imports: `maggie design icon-glyph-check`, `maggie design
114
+ verify`, and `maggie service import-stages-validate`, `import-readiness`
115
+ and `fact-provenance`.
116
+ - Feedback and release: `validate_docs_freshness.py --release-metadata`,
117
+ `maggie docs rollout-status`, and stdin batch input.
118
+
119
+ The 0.7.48 release remains included: it processed the 27 hosted feedback
120
+ records of 2026-10-10 (batch 26) and added the Booking email-template
94
121
  contract/CLI sync with escaped `arrivalNote` rendering:
95
122
 
96
123
  - Social Share: `adapters` enforces one canonical OAuth scope set per provider
@@ -701,8 +728,8 @@ artifact schemas.
701
728
  Recommended upgrade sequence for the current release:
702
729
 
703
730
  ```bash
704
- npx @topy-ai/maggie@0.7.48 update --scope project --project . --force
705
- npx @topy-ai/maggie@0.7.48 cleanup --scope project --project .
731
+ npx @topy-ai/maggie@0.7.49 update --scope project --project . --force
732
+ npx @topy-ai/maggie@0.7.49 cleanup --scope project --project .
706
733
  ```
707
734
 
708
735
  Maintainers should pass npm credentials through the repository helper, never
package/bin/maggie.js CHANGED
@@ -130,6 +130,8 @@ Usage:
130
130
  maggie design app-validate --project PATH --plan PATH --runtime-evidence FILE --rendered-dir PATH --confirm
131
131
  maggie design icon-inventory --project PATH --source-dir src --runtime assets/icons.css --output docs/icon-inventory.json
132
132
  maggie design icon-release-gate --icon-report FILE --browser-report FILE --output FILE
133
+ maggie design icon-glyph-check (--base-url URL | --dist DIR) --route / --output FILE
134
+ maggie design verify JOB_ID (--base-url URL | --dist DIR) [--stage before|after] [--build-command CMD]
133
135
  maggie design author --project PATH --route /about --purpose TEXT --audience TEXT --confirm
134
136
  maggie design markup-check --html FILE [--require-content-keys]
135
137
  maggie design in-place --project PATH --route /pricing [--content-source PATH]
@@ -151,6 +153,9 @@ Usage:
151
153
  maggie service inspect --project PATH
152
154
  maggie service status --project PATH
153
155
  maggie service orchestration-validate --project PATH --manifest FILE
156
+ maggie service import-stages-validate --project PATH --manifest FILE
157
+ maggie service import-readiness --project PATH [--python-module M] [--browser] [--webdriver] [--env NAME] [--country LABEL]
158
+ maggie service fact-provenance --project PATH --facts FILE [--output FILE]
154
159
  maggie service convert-page <page-path> --project PATH
155
160
  maggie service match-pages --project PATH --pages-dir src/pages
156
161
  maggie deployment --project PATH --target vps-with-cloudflare-dns
@@ -158,6 +163,8 @@ Usage:
158
163
  maggie deployment secret-parity --manifest api-1.json --manifest api-2.json --required KEY
159
164
  maggie deployment env-isolation --project PATH --production-env .env.production
160
165
  maggie deployment readiness --project PATH
166
+ maggie deployment collect --project PATH --config .maggie/deployment/collector.json
167
+ maggie deployment auth-canary --plan auth-canary-plan.json [--allow-mutations] --output FILE
161
168
  maggie deployment parity --project PATH --evidence FILE --output FILE
162
169
  maggie deployment canary --project PATH --asset URL=SHA256 --render-report report.json --output docs/deployment-canary.json
163
170
  maggie deployment release-manifest --evidence FILE --output FILE
@@ -177,7 +184,7 @@ Usage:
177
184
  maggie release PATH --profile .maggie/release-profile.json --environment staging --target vps-with-cloudflare-dns
178
185
  maggie api lifecycle --project PATH [--execute --allow-quota]
179
186
  maggie memory <init|list|search|context|add|record-error|transition|export> --project PATH
180
- maggie localization <extract|plan|generate|preview|validate|review|publish|stale|glossary> [options]
187
+ maggie localization <extract|plan|generate|preview|validate|review|publish|stale|glossary|email-matrix|lifecycle> [options]
181
188
  maggie seo performance|images|sitemap|indexnow|social-cards|head-tags [options] (sitemap supports strict validate and agent-files)
182
189
  maggie feedback <collect|preview|batch|batch-review|session-summary|submit|list> [options]
183
190
  maggie qa <start|record|summary|export|assertion-audit|cors-preflight> [options]
@@ -188,6 +195,9 @@ Usage:
188
195
  maggie verification coverage --contract FILE --evidence FILE
189
196
  maggie ops audit|preflight|verify|lockfiles|seed-manifest|google-capabilities|favicon-check --project PATH
190
197
  maggie ops google-capabilities --project PATH --report FILE [--output FILE]
198
+ maggie ops google-diagnose --code CODE [--reason TEXT] [--http-status N] [--provider P]
199
+ maggie ops google-ads-preflight|google-ads-keyword-ideas --customer-id ID [--login-customer-id ID]
200
+ maggie ops notifications catalogue|templates|preflight|health|retention|alerts --project PATH ...
191
201
  maggie ops preflight --project PATH --write
192
202
 
193
203
  Examples:
@@ -588,16 +598,17 @@ function marketplace(args) {
588
598
 
589
599
  function service(args) {
590
600
  const root = projectRoot(args);
591
- const scriptName = args[0] === "orchestration-validate" ? "maggie_service_onboarding.py" : "maggie_service_booking.py";
601
+ const importCommands = ["import-stages-validate", "import-readiness", "fact-provenance"];
602
+ const scriptName = args[0] === "orchestration-validate" ? "maggie_service_onboarding.py" : importCommands.includes(args[0]) ? "maggie_service_import.py" : "maggie_service_booking.py";
592
603
  const script = toolScript(scriptName, root);
593
604
  if (!existsSync(script)) throw new Error(`service booking CLI is missing: ${script}`);
594
- const result = spawnSync("python3", [script, ...args], { stdio: "inherit", cwd: root, env: { ...process.env, MAGGIE_VERSION: PACKAGE_VERSION } });
605
+ const result = spawnSync("python3", [script, ...(scriptName === "maggie_service_onboarding.py" ? args.slice(1) : args)], { stdio: "inherit", cwd: root, env: { ...process.env, MAGGIE_VERSION: PACKAGE_VERSION } });
595
606
  if (result.error) throw result.error;
596
607
  process.exitCode = result.status ?? 1;
597
608
  }
598
609
 
599
610
  function docs(args) {
600
- if (args[0] && args[0] !== "audit") throw new Error("docs command must be audit");
611
+ if (args[0] && !["audit", "rollout-status"].includes(args[0])) throw new Error("docs command must be audit or rollout-status");
601
612
  workflowCli("maggie_docs.py", args);
602
613
  }
603
614
 
@@ -767,6 +778,8 @@ try {
767
778
  else if (command === "ops") workflowCli("maggie_ops.py", args);
768
779
  else if (command === "deployment" && args[0] === "canary") workflowCli("maggie_deployment_canary.py", args.slice(1));
769
780
  else if (command === "deployment" && args[0] === "readiness") workflowCli("maggie_deployment_readiness.py", args.slice(1));
781
+ else if (command === "deployment" && args[0] === "auth-canary") workflowCli("maggie_deployment_auth_canary.py", args.slice(1));
782
+ else if (command === "deployment" && args[0] === "collect") workflowCli("maggie_deployment_collect.py", args.slice(1));
770
783
  else if (command === "deployment" && args[0] === "parity") workflowCli("maggie_deployment_parity.py", args.slice(1));
771
784
  else if (command === "deployment" && args[0] === "release-manifest") workflowCli("maggie_release_manifest.py", args.slice(1));
772
785
  else if (command === "deployment" && args[0] === "runtime-preflight") workflowCli("maggie_runtime_preflight.py", args.slice(1));
@@ -36,7 +36,8 @@
36
36
  "productRole": {"type": "string", "minLength": 1, "maxLength": 200},
37
37
  "evidence": {"$ref": "#/$defs/evidence"},
38
38
  "capabilities": {"$ref": "#/$defs/capabilities"},
39
- "nextAction": {"type": "string", "minLength": 1, "maxLength": 500}
39
+ "nextAction": {"type": "string", "minLength": 1, "maxLength": 500},
40
+ "failure": {"description": "Optional redacted provider failure: error code/reason and HTTP status only. The validator maps it to one prerequisite and safe next action and never echoes it.", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": {"code": {"type": "string", "maxLength": 300}, "reason": {"type": "string", "maxLength": 300}, "httpStatus": {"type": "integer", "minimum": 100, "maximum": 599}}}
40
41
  }
41
42
  },
42
43
  "verifiedRef": {
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggie.noblox.app/contracts/maggie-content/email-localization-v1.schema.json",
4
+ "title": "Maggie localized email template manifest v1",
5
+ "description": "Template matrix checked by `maggie localization email-matrix`. Structural shape only; the CLI enforces locale precedence, variable preservation, HTML/plain-text parity, market routes, untranslated values and approval.",
6
+ "type": "object",
7
+ "required": ["schemaVersion", "sourceLocale", "locales", "templates"],
8
+ "properties": {
9
+ "schemaVersion": {"const": "maggie-email-localization.v1"},
10
+ "sourceLocale": {"type": "string", "minLength": 2},
11
+ "locales": {"type": "array", "items": {"type": "string"}, "minItems": 1, "uniqueItems": true},
12
+ "markets": {
13
+ "type": "object",
14
+ "additionalProperties": {
15
+ "type": "object",
16
+ "properties": {
17
+ "locales": {"type": "array", "items": {"type": "string"}},
18
+ "routePrefix": {"type": "string", "pattern": "^/"}
19
+ }
20
+ }
21
+ },
22
+ "glossary": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "required": ["term", "locale", "translation"],
27
+ "properties": {"term": {"type": "string"}, "locale": {"type": "string"}, "translation": {"type": "string"}}
28
+ }
29
+ },
30
+ "templates": {
31
+ "type": "array",
32
+ "minItems": 1,
33
+ "items": {
34
+ "type": "object",
35
+ "required": ["id", "category", "variables", "localeResolution", "locales"],
36
+ "properties": {
37
+ "id": {"type": "string", "minLength": 1},
38
+ "category": {"enum": ["transactional", "support", "marketing"]},
39
+ "variables": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
40
+ "localeResolution": {
41
+ "type": "array",
42
+ "items": {"enum": ["user", "market", "account", "fallback"]},
43
+ "minItems": 1,
44
+ "uniqueItems": true
45
+ },
46
+ "requiredLocales": {"type": "array", "items": {"type": "string"}},
47
+ "cta": {"type": "object", "properties": {"route": {"type": "string"}}},
48
+ "fixtures": {"type": "object", "description": "Synthetic preview values only; never customer data."},
49
+ "locales": {
50
+ "type": "object",
51
+ "additionalProperties": {
52
+ "type": "object",
53
+ "required": ["subject", "html", "text"],
54
+ "properties": {
55
+ "subject": {"type": "string"},
56
+ "html": {"type": "string"},
57
+ "text": {"type": "string"},
58
+ "ctaRoute": {"type": "string"},
59
+ "market": {"type": "string"},
60
+ "approval": {
61
+ "type": "object",
62
+ "properties": {
63
+ "status": {"enum": ["pending", "approved", "rejected"]},
64
+ "reviewer": {"type": "string"},
65
+ "approvedAt": {"type": "string", "format": "date-time"}
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "callSites": {
75
+ "type": "array",
76
+ "description": "Where the host sends each template and how it resolves the locale.",
77
+ "items": {
78
+ "type": "object",
79
+ "required": ["template", "localeSource"],
80
+ "properties": {
81
+ "id": {"type": "string"},
82
+ "template": {"type": "string"},
83
+ "path": {"enum": ["fulfilment", "outbox", "direct", "preview"]},
84
+ "localeSource": {"enum": ["resolved", "user", "market", "account", "fallback", "accept-language", "hard-coded"]}
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggie.noblox.app/contracts/maggie-content/lifecycle-email-v1.schema.json",
4
+ "title": "Maggie consent-aware lifecycle email plan v1",
5
+ "description": "Plan validated by `maggie localization lifecycle`. Nothing is sendable until approved; the host owns audience data, consent records, delivery and reporting. Maggie never sends.",
6
+ "type": "object",
7
+ "required": ["schemaVersion", "stages", "defaults", "templates"],
8
+ "properties": {
9
+ "schemaVersion": {"const": "maggie-lifecycle-email.v1"},
10
+ "stages": {"const": ["plan", "segment", "consent-check", "preview", "approve", "schedule", "send", "report"]},
11
+ "defaults": {"type": "object", "required": ["send"], "properties": {"send": {"const": "disabled"}}},
12
+ "templates": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "required": ["id", "kind", "category", "frequency", "sendable"],
17
+ "properties": {
18
+ "id": {"type": "string", "minLength": 1},
19
+ "kind": {"enum": ["opt-in-confirmation", "welcome", "digest", "recommendation", "gift-follow-up", "voucher-follow-up", "waitlist-follow-up", "merchant-lead-digest", "campaign-announcement", "re-engagement"]},
20
+ "category": {"enum": ["transactional", "support", "marketing"]},
21
+ "consent": {
22
+ "type": "object",
23
+ "properties": {
24
+ "basis": {"enum": ["opt-in", "double-opt-in", "soft-opt-in", "legitimate-interest-b2b"]},
25
+ "category": {"type": "string"}
26
+ }
27
+ },
28
+ "unsubscribe": {"type": "object", "properties": {"path": {"type": "string"}}},
29
+ "preferenceCentre": {"type": "string"},
30
+ "frequency": {
31
+ "type": "object",
32
+ "required": ["maxPerWindow", "window"],
33
+ "properties": {"maxPerWindow": {"type": "integer", "minimum": 1}, "window": {"type": "string", "description": "ISO 8601 duration, e.g. P7D"}}
34
+ },
35
+ "attribution": {"type": "object", "properties": {"fields": {"type": "array", "items": {"type": "string"}}}},
36
+ "approval": {"$ref": "#/$defs/approval"},
37
+ "sendable": {"type": "boolean"}
38
+ }
39
+ }
40
+ },
41
+ "campaigns": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "object",
45
+ "required": ["id", "templates", "audience", "sendable"],
46
+ "properties": {
47
+ "id": {"type": "string"},
48
+ "templates": {"type": "array", "items": {"type": "string"}},
49
+ "audience": {
50
+ "type": "object",
51
+ "properties": {
52
+ "segment": {"type": "string"},
53
+ "requiresConsent": {"type": "boolean"},
54
+ "suppression": {"type": "boolean"},
55
+ "dedupe": {"type": "string"}
56
+ }
57
+ },
58
+ "schedule": {"type": "object"},
59
+ "approval": {"$ref": "#/$defs/approval"},
60
+ "sendable": {"type": "boolean"},
61
+ "report": {"type": "object", "properties": {"metrics": {"type": "array", "items": {"type": "string"}}}}
62
+ }
63
+ }
64
+ }
65
+ },
66
+ "$defs": {
67
+ "approval": {
68
+ "type": "object",
69
+ "properties": {
70
+ "status": {"enum": ["pending", "approved", "rejected"]},
71
+ "reviewer": {"type": "string"},
72
+ "approvedAt": {"type": "string", "format": "date-time"}
73
+ }
74
+ }
75
+ }
76
+ }
@@ -7,6 +7,7 @@
7
7
  "properties": {
8
8
  "schemaVersion": {"const": "maggie-deployment-readiness.v1"},
9
9
  "status": {"enum": ["passed", "failed", "inconclusive"]},
10
+ "collector": {"type": "object", "description": "present when produced by maggie deployment collect: config fingerprint, release, and per-adapter run metadata"},
10
11
  "checks": {
11
12
  "type": "object",
12
13
  "required": ["unitRegression", "packageSmoke", "browserEvidence", "renderedCanary", "deploymentPreflight"],
@@ -17,7 +18,11 @@
17
18
  "browserEvidence": {"$ref": "#/$defs/check"},
18
19
  "renderedCanary": {"$ref": "#/$defs/check"},
19
20
  "deploymentPreflight": {"$ref": "#/$defs/check"},
20
- "runtimeParity": {"$ref": "#/$defs/check"}
21
+ "runtimeParity": {"$ref": "#/$defs/check"},
22
+ "hostHealth": {"$ref": "#/$defs/check"},
23
+ "releaseIdentity": {"$ref": "#/$defs/check"},
24
+ "rollbackEvidence": {"$ref": "#/$defs/check"},
25
+ "authenticatedCanary": {"$ref": "#/$defs/check"}
21
26
  }
22
27
  }
23
28
  },
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggie.topy.ai/contracts/maggie-ops/marketing-run-v1.schema.json",
4
+ "title": "Maggie marketing run",
5
+ "description": "One project-scoped run joining content, Social Share, Ads, and measurement. References evidence, approvals, mutations and readbacks by ID; never contains secrets or provider payloads. Validated by tools/clis/maggie_marketing_run.py, which also enforces cross-field rules (approval before external mutation, readback for succeeded mutations, regulated-content review gating only external publication, no secret fields).",
6
+ "type": "object",
7
+ "required": ["schemaVersion", "runId", "projectRef", "objective", "conversion", "channels", "timezone", "mode", "approval", "scheduleLayers"],
8
+ "not": {"anyOf": [{"required": ["scheduled_at"]}, {"required": ["scheduledAt"]}]},
9
+ "properties": {
10
+ "schemaVersion": {"const": "maggie-marketing-run-v1"},
11
+ "runId": {"type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{2,127}$"},
12
+ "projectRef": {"type": "string", "minLength": 1},
13
+ "objective": {"type": "string", "minLength": 1},
14
+ "conversion": {
15
+ "type": "object",
16
+ "required": ["event", "source"],
17
+ "properties": {"event": {"type": "string"}, "source": {"type": "string"}}
18
+ },
19
+ "channels": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
20
+ "timezone": {"type": "string", "description": "IANA time zone for the run."},
21
+ "mode": {"enum": ["draft", "scheduled", "executing", "completed", "cancelled"]},
22
+ "sourceRevisions": {
23
+ "type": "array",
24
+ "items": {"type": "object", "required": ["sourceId", "revision"], "properties": {"sourceId": {"type": "string"}, "revision": {"type": "string"}}}
25
+ },
26
+ "capabilityEvidence": {"type": "array", "items": {"type": "string", "minLength": 1}},
27
+ "approval": {
28
+ "type": "object",
29
+ "required": ["state"],
30
+ "properties": {
31
+ "state": {"enum": ["pending", "approved", "rejected", "not_required"]},
32
+ "actor": {"type": ["string", "null"]},
33
+ "approvalId": {"type": ["string", "null"]}
34
+ }
35
+ },
36
+ "scheduleLayers": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/scheduleLayer"}},
37
+ "mutations": {"type": "array", "items": {"$ref": "#/$defs/mutation"}},
38
+ "readbacks": {
39
+ "type": "array",
40
+ "items": {"type": "object", "required": ["readbackId"], "properties": {"readbackId": {"type": "string"}, "mutationRef": {"type": "string"}, "evidenceRef": {"type": "string"}}}
41
+ },
42
+ "policy": {
43
+ "type": "object",
44
+ "description": "Regulated-content review. Default off. When on, only external publication waits for an approved review; delivery, drafts, SEO/GEO and measurement continue.",
45
+ "properties": {
46
+ "regulatedContent": {"type": "boolean", "default": false},
47
+ "reviewRequired": {"type": "boolean", "default": true},
48
+ "reviewState": {"enum": ["not_required", "pending", "approved", "rejected"]},
49
+ "reviewerRef": {"type": "string"}
50
+ }
51
+ },
52
+ "stages": {
53
+ "type": "object",
54
+ "propertyNames": {"enum": ["delivery", "draft", "seo_geo", "measurement", "external_publication"]},
55
+ "additionalProperties": {"type": "object", "properties": {"status": {"type": "string"}, "reason": {"type": "string"}}}
56
+ },
57
+ "measurement": {"type": "object"}
58
+ },
59
+ "$defs": {
60
+ "scheduleLayer": {
61
+ "type": "object",
62
+ "required": ["layer", "timezone", "owner", "status", "reconciliation"],
63
+ "properties": {
64
+ "layer": {"enum": ["infrastructure", "content_calendar", "campaign_flight", "measurement_window"]},
65
+ "id": {"type": "string"},
66
+ "timezone": {"type": "string"},
67
+ "owner": {"type": "string", "minLength": 1},
68
+ "status": {"enum": ["planned", "active", "paused", "completed", "cancelled"]},
69
+ "start": {"type": "string"},
70
+ "end": {"type": "string"},
71
+ "lagDays": {"type": "integer", "minimum": 0},
72
+ "scheduleRef": {"type": "string", "description": "infrastructure only: the maggie-schedule job name."},
73
+ "reconciliation": {"type": "string", "minLength": 1, "description": "How this layer's actual state is read back and reconciled."}
74
+ }
75
+ },
76
+ "mutation": {
77
+ "type": "object",
78
+ "required": ["mutationId", "kind", "status"],
79
+ "properties": {
80
+ "mutationId": {"type": "string"},
81
+ "kind": {"enum": ["external_publication", "ads_change", "content_delivery", "draft_creation", "configuration"]},
82
+ "channel": {"type": "string"},
83
+ "status": {"enum": ["planned", "pending", "succeeded", "failed", "cancelled"]},
84
+ "idempotencyKey": {"type": "string"},
85
+ "approvalRef": {"type": "string"}
86
+ }
87
+ }
88
+ }
89
+ }