@topy-ai/maggie 0.7.45 → 0.7.46

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 (28) hide show
  1. package/README-zh-TW.md +7 -2
  2. package/README.md +45 -3
  3. package/bin/maggie.js +2 -2
  4. package/bundled-contracts/google-integrations/capability-report-v2.schema.json +76 -0
  5. package/bundled-contracts/google-integrations/external-write-readback-v1.schema.json +36 -0
  6. package/bundled-contracts/maggie-deployment/deployer-delegation-v1.schema.json +20 -0
  7. package/bundled-contracts/maggie-deployment/release-profile-v1.schema.json +34 -0
  8. package/bundled-contracts/maggie-design/browser-capability-v1.schema.json +33 -0
  9. package/bundled-contracts/maggie-feedback/evidence-bundle-v1.schema.json +38 -0
  10. package/bundled-references/browser-inspection.md +17 -0
  11. package/bundled-references/google-integrations-runbook.md +8 -1
  12. package/bundled-skills/maggie-clone/SKILL.md +7 -0
  13. package/bundled-skills/maggie-deployment/SKILL.md +49 -15
  14. package/bundled-skills/maggie-feedback/SKILL.md +23 -0
  15. package/bundled-skills/maggie-ops/SKILL.md +22 -0
  16. package/bundled-skills/maggie-seo-geo/SKILL.md +4 -1
  17. package/bundled-tools/clis/maggie_analytics.py +8 -0
  18. package/bundled-tools/clis/maggie_browser_audit.py +13 -2
  19. package/bundled-tools/clis/maggie_deployment.py +167 -6
  20. package/bundled-tools/clis/maggie_feedback.py +115 -1
  21. package/bundled-tools/clis/maggie_ops.py +33 -0
  22. package/bundled-tools/clis/maggie_release.py +124 -19
  23. package/bundled-tools/runtime/browser_capability.py +143 -0
  24. package/bundled-tools/runtime/external_write.py +122 -0
  25. package/bundled-tools/runtime/google_capabilities.py +37 -5
  26. package/package.json +1 -1
  27. package/references/browser-inspection.md +17 -0
  28. package/references/google-integrations-runbook.md +8 -1
package/README-zh-TW.md CHANGED
@@ -29,7 +29,12 @@ npx @topy-ai/maggie init --scope project --agent all
29
29
  npx @topy-ai/maggie doctor --scope project --project .
30
30
  ```
31
31
 
32
- 目前 release 是 `0.7.45`。新增 Codex/Claude Code 的一次性 user-scope 安裝、bundled
32
+ 目前 release 是 `0.7.46`。新增 browser adapter capability preflight、privacy-safe
33
+ feedback evidence references/relationships、bounded batch-review evidence graph、
34
+ remediation suggestions,以及 root-level unittest import 支援。`browser-audit
35
+ --check-browser` 會在導覽前拒絕 missing/incompatible adapter,包括解析成
36
+ `xdg-open` 的系統 `browse`;feedback graph 不保存 raw payload、logs、credentials
37
+ 或本機路徑。另包含 0.7.45 的 Codex/Claude Code 一次性 user-scope 安裝、bundled
33
38
  workflow runner 與 user-scope maintenance commands;並完成 2026-09-24 booking feedback batch:MaggieDash
34
39
  Calendar availability grid/free-slot entry,以及 ORA modal focus restoration
35
40
  的驗證證據。另新增 secret-free Starter marketplace provisioning
@@ -100,7 +105,7 @@ structure drift 或重複 treatment product 時 fail closed。
100
105
  deployment、memory、feedback 和 MaggieDash。內容先 draft/review,外部寫入、
101
106
  publish 與 production deployment 需要明確確認。
102
107
 
103
- 目前 source tree 的正式 release 是 `0.7.45`。本版完成 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
108
+ 目前 source tree 的正式 release 是 `0.7.46`。本版完成 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
104
109
  dispatch、`maggie --version`、feedback batch review 聚合與重複偵測、marketplace enrichment evidence、booking
105
110
  worker/resolver evidence,以及 read-only migration preflight。它也包含 host-owned mobile app surface contract、signed-in
106
111
  camera-state QA、直接 Astro route resolution、correlated feedback batch,以及
package/README.md CHANGED
@@ -89,7 +89,12 @@ 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
- The current release is `0.7.45`. It adds one-time user-scope installation for
92
+ The current release is `0.7.46`. It adds browser-adapter capability preflight,
93
+ privacy-safe feedback evidence references/relationships, bounded batch-review
94
+ evidence graphs, remediation suggestions, and root-level unittest import
95
+ support. `browser-audit --check-browser` rejects missing or incompatible
96
+ adapters before navigation, including a system `browse`/`xdg-open` opener.
97
+ It also includes the 0.7.45 one-time user-scope installation for
93
98
  Codex and Claude Code, a bundled workflow runner, and scoped maintenance
94
99
  commands. It also closes the 2026-09-24 booking feedback
95
100
  batch with the canonical MaggieDash Calendar availability grid/free-slot
@@ -490,6 +495,23 @@ maggie blog auto-publish-gate \
490
495
 
491
496
  ### Design and deployment release gates
492
497
 
498
+ `maggie release` requires an explicit `.maggie/release-profile.json` capability
499
+ manifest. This prevents a public Astro site from being evaluated against
500
+ unrelated MaggieDash, Booking, migration, service-catalogue, or analytics
501
+ artifacts. A minimal profile is:
502
+
503
+ ```json
504
+ {
505
+ "schemaVersion": "maggie-release-profile.v1",
506
+ "profile": "public-astro",
507
+ "projectType": "astro",
508
+ "capabilities": ["deployment"]
509
+ }
510
+ ```
511
+
512
+ Declare optional capabilities only when the project owns their evidence. The
513
+ release report records undeclared optional gates as `skipped`.
514
+
493
515
  Check source-to-runtime icon coverage before shipping a design:
494
516
 
495
517
  ```bash
@@ -588,6 +610,10 @@ maggie deployment readiness --project . \
588
610
  --output .maggie/deployment-readiness.json
589
611
  ```
590
612
 
613
+ Individual suites can also be invoked from the repository root with
614
+ `python3 -m unittest tools.tests.test_maggie_feedback_batch`. Use the
615
+ regression runner for the complete discovered suite.
616
+
591
617
  The readiness report follows `maggie-deployment-readiness.v1`. It reports unit
592
618
  regression, package smoke, host browser evidence, rendered canary, and
593
619
  deployment preflight separately. Missing host adapter evidence is
@@ -631,8 +657,8 @@ artifact schemas.
631
657
  Recommended upgrade sequence for the current release:
632
658
 
633
659
  ```bash
634
- npx @topy-ai/maggie@0.7.45 update --scope project --project . --force
635
- npx @topy-ai/maggie@0.7.45 cleanup --scope project --project .
660
+ npx @topy-ai/maggie@0.7.46 update --scope project --project . --force
661
+ npx @topy-ai/maggie@0.7.46 cleanup --scope project --project .
636
662
  ```
637
663
 
638
664
  Maintainers should pass npm credentials through the repository helper, never
@@ -930,6 +956,16 @@ The `maggie-feedback-batch-review.v1` report retains bounded observations,
930
956
  missing-index and duplicate checks, and privacy flags. It never contains raw
931
957
  responses, local paths, or secrets.
932
958
 
959
+ Add safe relationships when a report must point to a test or related run:
960
+
961
+ ```bash
962
+ maggie feedback collect --project . --summary "Adapter unavailable" \
963
+ --evidence-ref test:browser-capability:passed \
964
+ --relationship same-run=clone-001
965
+ ```
966
+
967
+ Batch review also emits bounded `evidenceGraph` and remediation suggestions.
968
+
933
969
  The same evidence-first pattern is available for the other maintainer checks:
934
970
 
935
971
  ```bash
@@ -1179,6 +1215,12 @@ maggie browser-audit https://example.com \
1179
1215
  It captures scroll/geometry samples and screenshots, then fails on hidden
1180
1216
  required elements, horizontal overflow or invalid sticky positioning.
1181
1217
 
1218
+ Before navigation, the command writes a redacted
1219
+ `maggie-browser-capability.v1` report and rejects missing or incompatible
1220
+ adapters, including a system `browse`/`xdg-open` desktop opener. Add
1221
+ `--check-browser` to run only this preflight and receive bounded
1222
+ installation/fallback guidance.
1223
+
1182
1224
  List every installed skill and command:
1183
1225
 
1184
1226
  ```bash
package/bin/maggie.js CHANGED
@@ -153,7 +153,7 @@ Usage:
153
153
  maggie brand-kit --manifest FILE | --project PATH --design DESIGN.md [--write --confirm]
154
154
  maggie npm11 --project PATH [--smoke --confirm]
155
155
  maggie booking-delivery [--policy FILE]
156
- maggie release PATH --environment staging --target vps-with-cloudflare-dns
156
+ maggie release PATH --profile .maggie/release-profile.json --environment staging --target vps-with-cloudflare-dns
157
157
  maggie api lifecycle --project PATH [--execute --allow-quota]
158
158
  maggie memory <init|list|search|context|add|record-error|transition|export> --project PATH
159
159
  maggie localization <extract|plan|generate|preview|validate|review|publish|stale|glossary> [options]
@@ -163,7 +163,7 @@ Usage:
163
163
  maggie site-audit URL [--crawl] [--access-log FILE] [--require-sitemap-request] [--languages en-GB,es-MX,ja-JP] [--check-hreflang] [--check-internal-links]
164
164
  maggie site-audit URL --crawl --save-baseline FILE --reviewer NAME
165
165
  maggie site-audit URL --crawl --baseline FILE [--reason-all REASON]
166
- maggie browser-audit URL --browse PATH --output DIR --required SELECTOR [--sticky SELECTOR] [--interactions FILE]
166
+ maggie browser-audit URL --browse PATH --output DIR [--required SELECTOR] [--sticky SELECTOR] [--interactions FILE] [--check-browser]
167
167
  maggie verification coverage --contract FILE --evidence FILE
168
168
  maggie ops audit|preflight|verify|lockfiles|seed-manifest|google-capabilities|favicon-check --project PATH
169
169
  maggie ops google-capabilities --project PATH --report FILE [--output FILE]
@@ -0,0 +1,76 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggie.noblox.app/contracts/google-integrations/capability-report-v2.json",
4
+ "title": "Maggie Google integrations capability report v2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "generatedAt", "providerResults", "passed", "mutationsAllowed"],
8
+ "properties": {
9
+ "schemaVersion": {"const": "maggie-google-capability-report.v2"},
10
+ "generatedAt": {"type": "string", "minLength": 1},
11
+ "providerResults": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/providerResult"}},
12
+ "passed": {"type": "boolean"},
13
+ "mutationsAllowed": {"const": false}
14
+ },
15
+ "$defs": {
16
+ "providerResult": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": ["provider", "resource", "activeAccount", "target", "authMode", "scopes", "productRole", "evidence", "capabilities", "nextAction"],
20
+ "properties": {
21
+ "provider": {"enum": ["gsc", "ga4", "gtm", "google-ads", "firebase"]},
22
+ "resource": {"type": "string", "minLength": 1, "maxLength": 200},
23
+ "activeAccount": {"$ref": "#/$defs/verifiedRef"},
24
+ "target": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "required": ["id", "kind", "verified"],
28
+ "properties": {
29
+ "id": {"type": "string", "minLength": 1, "maxLength": 200},
30
+ "kind": {"enum": ["property", "container", "customer", "project", "site", "account"]},
31
+ "verified": {"const": true}
32
+ }
33
+ },
34
+ "authMode": {"enum": ["desktop-oauth", "service-account-impersonation", "none"]},
35
+ "scopes": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
36
+ "productRole": {"type": "string", "minLength": 1, "maxLength": 200},
37
+ "evidence": {"$ref": "#/$defs/evidence"},
38
+ "capabilities": {"$ref": "#/$defs/capabilities"},
39
+ "nextAction": {"type": "string", "minLength": 1, "maxLength": 500}
40
+ }
41
+ },
42
+ "verifiedRef": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["id", "verified"],
46
+ "properties": {
47
+ "id": {"type": "string", "pattern": "^[^@\\s]{1,200}$"},
48
+ "verified": {"const": true}
49
+ }
50
+ },
51
+ "evidence": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["verified", "endpoint", "statusCode", "readOnly"],
55
+ "properties": {
56
+ "verified": {"type": "boolean"},
57
+ "endpoint": {"type": "string", "minLength": 1, "maxLength": 500},
58
+ "statusCode": {"type": "integer", "minimum": 100, "maximum": 599},
59
+ "readOnly": {"type": "boolean"},
60
+ "writeTest": {"type": "object"},
61
+ "adsPrerequisites": {"type": "object"}
62
+ }
63
+ },
64
+ "capabilities": {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "required": ["read", "report", "edit", "publish"],
68
+ "properties": {
69
+ "read": {"enum": ["verified", "not_tested", "not_available", "blocked"]},
70
+ "report": {"enum": ["verified", "not_tested", "not_available", "blocked"]},
71
+ "edit": {"enum": ["verified", "not_tested", "not_available", "blocked"]},
72
+ "publish": {"enum": ["verified", "not_tested", "not_available", "blocked"]}
73
+ }
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggie.noblox.app/contracts/google-integrations/external-write-readback-v1.json",
4
+ "title": "Maggie external provider write readback evidence v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "generatedAt", "provider", "resource", "operation", "idempotencyKey", "retry", "mutation", "readback", "duplicates", "orphaned", "cleanup", "mutationExecuted"],
8
+ "properties": {
9
+ "schemaVersion": {"const": "maggie-external-write-readback.v1"},
10
+ "generatedAt": {"type": "string", "minLength": 1},
11
+ "provider": {"enum": ["ga4", "gtm", "gsc", "google-ads", "firebase"]},
12
+ "resource": {"type": "string", "minLength": 1, "maxLength": 200},
13
+ "operation": {"type": "string", "pattern": "^[a-z][a-z0-9_.-]{1,63}$"},
14
+ "idempotencyKey": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{2,127}$"},
15
+ "retry": {
16
+ "type": "object", "additionalProperties": false, "required": ["attempt", "maxAttempts", "sameKeyOnRetry"],
17
+ "properties": {"attempt": {"type": "integer", "minimum": 1, "maximum": 3}, "maxAttempts": {"type": "integer", "minimum": 1, "maximum": 3}, "sameKeyOnRetry": {"const": true}}
18
+ },
19
+ "mutation": {
20
+ "type": "object", "additionalProperties": false, "required": ["status", "statusCode", "explicitConfirmation"],
21
+ "properties": {"status": {"enum": ["created", "updated", "no-op"]}, "statusCode": {"type": "integer", "minimum": 200, "maximum": 299}, "explicitConfirmation": {"const": true}}
22
+ },
23
+ "readback": {
24
+ "type": "object", "additionalProperties": false, "required": ["passed", "endpoint", "checks"],
25
+ "properties": {
26
+ "passed": {"const": true},
27
+ "endpoint": {"type": "string", "pattern": "^https://[^\\s?#]+$"},
28
+ "checks": {"type": "array", "minItems": 1, "items": {"type": "object"}}
29
+ }
30
+ },
31
+ "duplicates": {"type": "array", "maxItems": 0},
32
+ "orphaned": {"type": "array", "maxItems": 0},
33
+ "cleanup": {"type": "object", "additionalProperties": false, "required": ["status", "checked"], "properties": {"status": {"enum": ["not-needed", "passed"]}, "checked": {"const": true}}},
34
+ "mutationExecuted": {"const": true}
35
+ }
36
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggiedash.noblox.app/contracts/deployer-delegation-v1.schema.json",
4
+ "title": "Maggie deployment deployer delegation evidence v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "host", "user", "releaseRoot", "service", "state", "passed", "checks", "mutation"],
8
+ "properties": {
9
+ "schemaVersion": {"const": "maggie-deployment-delegation.v1"},
10
+ "host": {"type": "string", "minLength": 1},
11
+ "user": {"type": "string", "pattern": "^[a-z_][a-z0-9_-]{0,31}\\$?$"},
12
+ "releaseRoot": {"type": "string", "pattern": "^/[^\\r\\n]*$"},
13
+ "service": {"type": "string", "pattern": "^[A-Za-z0-9_.@-]+$"},
14
+ "state": {"enum": ["passed", "failed", "transient", "inconclusive"]},
15
+ "passed": {"type": "boolean"},
16
+ "checks": {"type": "object"},
17
+ "errors": {"type": "array", "items": {"type": "string"}},
18
+ "mutation": {"const": "not executed"}
19
+ }
20
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggiedash.noblox.app/contracts/release-profile-v1.schema.json",
4
+ "title": "Maggie release profile v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "profile", "capabilities"],
8
+ "properties": {
9
+ "schemaVersion": {"const": "maggie-release-profile.v1"},
10
+ "profile": {"type": "string", "pattern": "^[a-z][a-z0-9-]{1,63}$"},
11
+ "projectType": {"type": "string", "enum": ["astro", "nextjs", "sveltekit", "nuxt", "vite-react", "vite-vue", "other"]},
12
+ "capabilities": {
13
+ "type": "array",
14
+ "minItems": 1,
15
+ "uniqueItems": true,
16
+ "items": {
17
+ "enum": [
18
+ "deployment",
19
+ "scenario-qa",
20
+ "social-card-audit",
21
+ "migration",
22
+ "maggiedash-health",
23
+ "schedule",
24
+ "analytics-contract",
25
+ "analytics-release-gate",
26
+ "service-facts",
27
+ "maggiedash-schema",
28
+ "editorial-review",
29
+ "durable-site-evidence"
30
+ ]
31
+ }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggie.noblox.app/contracts/browser-capability-v1.schema.json",
4
+ "title": "Maggie browser adapter capability report v1",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "adapter", "status", "checks", "requiredCommands", "fallback"],
7
+ "properties": {
8
+ "schemaVersion": {"const": "maggie-browser-capability.v1"},
9
+ "adapter": {
10
+ "type": "object",
11
+ "required": ["requested"],
12
+ "properties": {
13
+ "requested": {"type": "string", "minLength": 1, "maxLength": 160},
14
+ "name": {"type": "string", "maxLength": 160},
15
+ "requestedPathFingerprint": {"type": ["string", "null"], "pattern": "^(sha256:[a-f0-9]{64})?$"},
16
+ "resolvedPathFingerprint": {"type": ["string", "null"], "pattern": "^(sha256:[a-f0-9]{64})?$"}
17
+ },
18
+ "additionalProperties": false
19
+ },
20
+ "status": {"enum": ["ready", "missing", "incompatible"]},
21
+ "errorCode": {"type": "string", "maxLength": 80},
22
+ "message": {"type": "string", "maxLength": 240},
23
+ "checks": {
24
+ "type": "object",
25
+ "required": ["resolved", "regularFile", "executable", "help", "requiredCommands", "interactionCommands"],
26
+ "additionalProperties": {"type": "boolean"}
27
+ },
28
+ "requiredCommands": {"type": "array", "items": {"type": "string"}, "minItems": 1, "maxItems": 20},
29
+ "missingCommands": {"type": "array", "items": {"type": "string"}, "maxItems": 20},
30
+ "fallback": {"type": "array", "items": {"type": "string", "maxLength": 240}, "maxItems": 8}
31
+ },
32
+ "additionalProperties": false
33
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://maggie.noblox.app/contracts/feedback-evidence-bundle-v1.schema.json",
4
+ "title": "Maggie privacy-safe feedback evidence bundle v1",
5
+ "type": "object",
6
+ "required": ["evidence", "relationships"],
7
+ "properties": {
8
+ "evidence": {
9
+ "type": "array",
10
+ "maxItems": 20,
11
+ "items": {
12
+ "type": "object",
13
+ "required": ["kind", "ref", "status"],
14
+ "properties": {
15
+ "kind": {"enum": ["test", "report", "screenshot", "command", "deployment", "issue", "commit", "artifact"]},
16
+ "ref": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,159}$"},
17
+ "status": {"enum": ["passed", "failed", "observed", "not-run", "unknown"]}
18
+ },
19
+ "additionalProperties": false
20
+ }
21
+ },
22
+ "relationships": {
23
+ "type": "array",
24
+ "maxItems": 20,
25
+ "items": {
26
+ "type": "object",
27
+ "required": ["kind", "target", "confidence"],
28
+ "properties": {
29
+ "kind": {"enum": ["related", "same-run", "same-fingerprint", "duplicates", "validates", "remediates", "caused-by"]},
30
+ "target": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/=-]{0,159}$"},
31
+ "confidence": {"enum": ["low", "medium", "high"]}
32
+ },
33
+ "additionalProperties": false
34
+ }
35
+ }
36
+ },
37
+ "additionalProperties": false
38
+ }
@@ -14,6 +14,23 @@ The browser capability must support:
14
14
  - slow scrolling, click, hover, keyboard focus, and back/forward navigation;
15
15
  - reading computed CSS, media sources, links, and visible accessibility labels.
16
16
 
17
+ Before navigation, Maggie runs a capability preflight against the configured
18
+ adapter. The report is `maggie-browser-capability.v1` and classifies the
19
+ adapter as `ready`, `missing`, or `incompatible`. This prevents a system
20
+ `browse`/`xdg-open` desktop opener from being mistaken for a browser adapter:
21
+
22
+ ```bash
23
+ maggie browser-audit https://example.com \
24
+ --browse "$HOME/.codex/skills/gstack/browse/dist/browse" \
25
+ --output .maggie/browser-audit --required body --check-browser
26
+ ```
27
+
28
+ The report contains only the adapter name, path fingerprints, capability
29
+ checks, and bounded installation/fallback guidance. If it is `missing` or
30
+ `incompatible`, install or enable an authorized Chrome/Playwright/gstack
31
+ adapter and pass its executable path. Maggie does not silently install a
32
+ browser runtime or use a desktop opener as a fallback.
33
+
17
34
  The minimum extraction result for a target is:
18
35
 
19
36
  ```text
@@ -111,8 +111,13 @@ maggie ops google-capabilities \
111
111
  ```
112
112
 
113
113
  The report contract is
114
- [`capability-report-v1.json`](../bundled-contracts/google-integrations/capability-report-v1.json).
114
+ [`capability-report-v2.schema.json`](../bundled-contracts/google-integrations/capability-report-v2.schema.json).
115
115
  The CLI writes a normalized result and never copies arbitrary input fields.
116
+ Every provider row must also identify the redacted active account and selected
117
+ target resource, both with `verified: true`; the target ID must equal the
118
+ selected `resource`. A report that only proves account discovery, or comes from
119
+ the wrong browser account/property, is rejected before a write workflow can use
120
+ it.
116
121
 
117
122
  ## Capability matrix
118
123
 
@@ -121,6 +126,8 @@ Every provider/resource row must expose this shape:
121
126
  | Field | Meaning |
122
127
  |---|---|
123
128
  | `provider` / `resource` | The Google product and scoped resource being checked |
129
+ | `activeAccount` | Redacted account/principal reference confirmed by the current auth session |
130
+ | `target` | Resource ID and kind confirmed in the current account; must match `resource` |
124
131
  | `authMode` | `desktop-oauth`, `service-account-impersonation`, or `none` |
125
132
  | `scopes` | Exact allowlisted OAuth scopes, never token values |
126
133
  | `productRole` | Role granted in the product, distinct from Cloud IAM |
@@ -104,6 +104,13 @@ for the inspection contract and [`references/operational-model.md`](references/o
104
104
  for run artifacts and phase gates. If no browser tool is available, stop before
105
105
  editing and report the missing capability.
106
106
 
107
+ When using the CLI adapter, run its capability preflight first. A command such
108
+ as `/usr/bin/browse` that resolves to `xdg-open` is a desktop opener, not a
109
+ browser adapter, and must be reported as incompatible. Use the report and its
110
+ bounded fallback guidance to install or select an authorized adapter; do not
111
+ silently substitute a desktop opener or install a browser runtime without the
112
+ user's approval.
113
+
107
114
  ## Phase 0: Preflight and plan
108
115
 
109
116
  1. Parse and normalize all target URLs. Reject invalid, inaccessible, or
@@ -301,28 +301,41 @@ output/state artifact and must never be used as the provider source argument.
301
301
  When validating a project schedule, pass `--project` so the URL is compared
302
302
  exactly with `.maggie/booking/services.json` `sourceUrl`.
303
303
 
304
- For a single read-only staging release gate, run. This gate also requires
305
- explicit editorial approval for all launch category copy; rendered draft
306
- evidence is not publication approval:
304
+ For a single read-only staging release gate, first declare the project's release
305
+ surface in `.maggie/release-profile.json`. The manifest is the source of truth;
306
+ Maggie does not infer Booking, MaggieDash, migration, analytics, service
307
+ catalogue, or editorial gates from incidental files. A minimal public Astro
308
+ site can use:
309
+
310
+ ```json
311
+ {
312
+ "schemaVersion": "maggie-release-profile.v1",
313
+ "profile": "public-astro",
314
+ "projectType": "astro",
315
+ "capabilities": ["deployment"]
316
+ }
317
+ ```
318
+
319
+ Add `migration`, `maggiedash-health`, `schedule`, `analytics-contract`,
320
+ `service-facts`, `editorial-review`, or `durable-site-evidence` only when that
321
+ project actually owns the corresponding artifact. For a single read-only
322
+ staging release gate, run:
307
323
 
308
324
  ```bash
309
325
  maggie tool maggie_release.py /path/to/project \
326
+ --profile /path/to/project/.maggie/release-profile.json \
310
327
  --environment staging --target vps-with-cloudflare-dns \
311
328
  --base-url https://staging.example.com
312
329
  ```
313
330
 
314
- If `.maggie/scenario-manifest.json` or `.maggie/qa-runs/` exists, the same
315
- preflight consumes the latest matching `maggie qa` run for the requested
316
- environment (and `--base-url`, when supplied). It blocks when a scenario is
317
- not passed, has no browser-adapter evidence, or the matching run is missing.
318
- Projects without scenario QA report `not-configured`; Maggie does not run the
319
- browser itself.
320
-
321
- This aggregates deployment, migration, provider-health, schedule, analytics,
322
- service-fact, editorial approval, durable SEO/route/category evidence,
323
- MaggieDash schema compatibility, and live runtime security-header checks. It writes
324
- `.maggie/release-preflight.json`; a failed gate blocks release. It never
325
- deploys, migrates, publishes, or sends provider requests.
331
+ If `scenario-qa` is declared, the preflight consumes the latest matching
332
+ `maggie qa` run for the requested environment (and `--base-url`, when
333
+ supplied). It blocks when a scenario is not passed, has no browser-adapter
334
+ evidence, or the matching run is missing. The report records every undeclared
335
+ optional gate as `skipped`, so a public site is not blocked by Booking- or
336
+ MaggieDash-only evidence. It writes `.maggie/release-preflight.json`; a failed
337
+ gate blocks release. It never deploys, migrates, publishes, or sends provider
338
+ requests.
326
339
 
327
340
  Generate a repeatable VPS runner as part of the plan. A deploy step that exists
328
341
  only in an operator's shell history is not a release contract:
@@ -338,6 +351,27 @@ Review the generated runner before execution. Its order is install → typecheck
338
351
  → migrate → build → carry agent state → switch → restart → verify → prune;
339
352
  retention keeps the current release and one rollback candidate.
340
353
 
354
+ Before writing a VPS plan or running the release gate, validate the real
355
+ least-privilege deploy account. This check is read-only: it verifies SSH access,
356
+ write permission for both the release root and `releases/`, and the exact
357
+ non-interactive systemd allowlist. A failed check does not create the plan or
358
+ runner:
359
+
360
+ ```bash
361
+ maggie deployment --verify-deployer \
362
+ --deployer-host "$DEPLOY_SERVER_IP" \
363
+ --deployer-user "$DEPLOY_SERVER_SSH_USER" \
364
+ --release-root /var/www/example \
365
+ --service example \
366
+ --output .maggie/deployment/deployer-delegation.json
367
+ ```
368
+
369
+ For a VPS `maggie release`, this evidence is required at
370
+ `.maggie/deployment/deployer-delegation.json` (or pass
371
+ `--deployer-evidence`). The generated runner waits for bounded transient
372
+ `000/502/503/504` startup responses after restart, while returning a clear
373
+ failure immediately for permanent HTTP responses.
374
+
341
375
  Production additionally requires `docs/deployment-rollback-smoke.json` with
342
376
  `passed: true`, `environment: production`, and `testedAt`. For an upgrade it
343
377
  must include a non-empty `previousRelease`. For the first production release,
@@ -34,6 +34,23 @@ The draft is written to `.maggie/feedback/`. It contains the Maggie version,
34
34
  skill, run ID, phase, error fingerprint, expected/actual result, reproduction
35
35
  steps, resolution, validation, and metadata-only screenshot references.
36
36
 
37
+ Attach bounded, privacy-safe evidence and relationships when a maintainer will
38
+ need to connect a report to a test, deployment, issue, or related run. Only
39
+ identifiers are stored; file contents, logs, credentials, and local paths are
40
+ never copied:
41
+
42
+ ```bash
43
+ maggie feedback collect --project . --summary "Adapter unavailable" \
44
+ --evidence-ref test:browser-capability:passed \
45
+ --evidence-ref report:browser-capability:v1 \
46
+ --relationship same-run=clone-001
47
+ ```
48
+
49
+ Evidence references are bounded and normalized into the
50
+ `maggie-feedback-evidence-bundle.v1` contract. The accepted kinds are
51
+ `test`, `report`, `screenshot`, `command`, `deployment`, `issue`, `commit`,
52
+ and `artifact`; relationships connect safe IDs such as feedback or run IDs.
53
+
37
54
  If a draft is marked fixed with `--fixed` (or the supplied run report says
38
55
  `fixed`), both `--resolution` and `--validation` are required. Feedback text
39
56
  also scrubs common POSIX/home/temp and Windows absolute paths by default while
@@ -78,6 +95,12 @@ This writes `.maggie/feedback/batches/<batch-id>-review.json` under the
78
95
  duplicate fingerprints/summaries, while retaining only redacted observations;
79
96
  review the aggregate and each draft before submitting.
80
97
 
98
+ Batch review also emits a bounded `evidenceGraph` and
99
+ `remediationSuggestions`. The graph links feedback IDs to evidence IDs and
100
+ safe related references, while suggestions flag duplicate fingerprints,
101
+ missing batch indexes, shared evidence, or a batch with no validation
102
+ references. These are review aids, not automatic issue or memory writes.
103
+
81
104
  Example:
82
105
 
83
106
  {
@@ -88,6 +88,14 @@ maggie ops google-capabilities --project . \
88
88
  --report .maggie/google-capability-input.json
89
89
  ```
90
90
 
91
+ The input must use `maggie-google-capability-report.v2`: each row records the
92
+ redacted active account, the selected target (`property`, `container`,
93
+ `customer`, `project`, or `site`), and the exact scopes. Both account and target
94
+ must be explicitly verified, and `target.id` must equal `resource`. The command
95
+ prints these safe identifiers and scopes before any separate provider adapter
96
+ is allowed to perform a write. A v1 report is rejected because it cannot prove
97
+ that the browser/session is on the intended Google account and property.
98
+
91
99
  The result separates `read`, `report`, `edit`, and `publish` for each
92
100
  provider/resource. Write and publish remain `not_tested` until the operator
93
101
  explicitly confirms the exact mutation and a successful read-back is captured.
@@ -164,6 +172,20 @@ Every mutation must validate the session, role, resource ownership/project
164
172
  scope, input schema, legal state transition, and idempotency/correlation key.
165
173
  Record actor, timestamp, previous state, next state, reason, and result.
166
174
 
175
+ For a GA4/GTM or other Google provider write, validate a hash-only
176
+ write/readback bundle before treating the operation as complete:
177
+
178
+ ```bash
179
+ maggie ops external-write-gate --project . \
180
+ --evidence .maggie/external-write-readback-input.json \
181
+ --output .maggie/external-write-readback.json
182
+ ```
183
+
184
+ The bundle requires one stable idempotency key across bounded retries, explicit
185
+ confirmation, successful readback fingerprints, an empty duplicate list, and
186
+ an empty orphaned-workspace list. It never stores provider payloads; an
187
+ incomplete or mismatched readback blocks the release gate.
188
+
167
189
  ### Operate
168
190
 
169
191
  Use the dashboard or API to perform an explicitly requested operation. Show an
@@ -125,7 +125,10 @@ maggie analytics release-gate --project . --environment staging \
125
125
 
126
126
  Use `contracts/maggie-seo/gsc-readiness-v1.schema.json` as the evidence
127
127
  boundary. Credentials and mutation scopes remain host-owned; a passing local
128
- contract is not proof of property ownership or live readback.
128
+ contract is not proof of property ownership or live readback. If a GA4/GTM
129
+ write is part of the workflow, also pass hash-only
130
+ `.maggie/external-write-readback.json` evidence to the analytics release gate;
131
+ duplicate or orphaned provider objects fail closed.
129
132
 
130
133
  ## Freeze and compare a reviewed site
131
134