blun-king-cli 9.1.597 → 9.1.600
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +17 -1
- package/agent-spine-plugin/CHANGELOG.md +1 -1
- package/agent-spine-plugin/docs/host-integration.md +1 -15
- package/agent-spine-plugin/docs/preflight-recall.md +1 -1
- package/agent-spine-plugin/scripts/check-install.js +1 -6
- package/agent-spine-plugin/scripts/hermetic-process.js +8 -0
- package/agent-spine-plugin/scripts/release-check.js +2 -3
- package/agent-spine-plugin/scripts/run-tests-hermetic.js +8 -11
- package/agent-spine-plugin/src/hook.js +40 -40
- package/agent-spine-plugin/src/lib/briefing.js +6 -3
- package/agent-spine-plugin/src/lib/hook-context.js +63 -64
- package/agent-spine-plugin/src/lib/hook-output.js +115 -94
- package/agent-spine-plugin/src/lib/hook-timeline.js +20 -11
- package/agent-spine-plugin/src/lib/host-instruction-budget.js +8 -14
- package/agent-spine-plugin/src/lib/mcp-timeline-tools.js +0 -7
- package/agent-spine-plugin/src/lib/pre-answer-timeline-recall.js +104 -0
- package/agent-spine-plugin/src/lib/session-timeline-codex.js +0 -4
- package/agent-spine-plugin/src/lib/session-timeline-enrollment-source.js +0 -3
- package/agent-spine-plugin/src/lib/session-timeline-enrollment-storage.js +0 -4
- package/agent-spine-plugin/src/lib/session-timeline-enrollment-transport.js +0 -2
- package/agent-spine-plugin/src/lib/session-timeline-enrollment.js +0 -22
- package/agent-spine-plugin/src/lib/session-timeline-host-origin.js +0 -4
- package/agent-spine-plugin/src/lib/session-timeline-prior.js +42 -50
- package/agent-spine-plugin/src/lib/session-timeline-provider.js +0 -3
- package/agent-spine-plugin/src/lib/session-timeline-query.js +0 -1
- package/agent-spine-plugin/src/lib/session-timeline-sid-acl.js +0 -4
- package/agent-spine-plugin/src/lib/session-timeline-source.js +0 -3
- package/agent-spine-plugin/src/lib/session-timeline-transport.js +0 -8
- package/agent-spine-plugin/src/lib/session-timeline-windows-acl.js +0 -3
- package/agent-spine-plugin/src/lib/session-timeline.js +370 -408
- package/agent-spine-plugin/src/lib/source-roots.js +26 -16
- package/agent-spine-plugin/src/lib/timeline-user-feedback.js +0 -1
- package/bin/core-bootstrap.js +18 -10
- package/bin/launcher-mode.js +5 -0
- package/bin/launcher-runtime.js +27 -0
- package/bin/verify-bundled-agent-sources.cjs +28 -2
- package/blun.mjs +798 -143
- package/bundled-agent-sources.json +192 -155
- package/package.json +1 -1
- package/standard-skills/translate-native/README.md +1334 -1
- package/standard-skills/translate-native/SKILL.md +1 -1
- package/standard-skills/translate-native/VERSION +1 -1
- package/standard-skills/translate-native/docs/PREMORTEM.md +901 -0
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION.md +208 -41
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_API.md +1319 -77
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_EVIDENCE_HTTP.md +66 -11
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_HTTP_PROVIDER.md +19 -1
- package/standard-skills/translate-native/docs/WEBSITE_LOCALIZATION_RECEIPT_VERIFIER_HTTP.md +24 -6
- package/standard-skills/translate-native/integrations/commercial_localization_profile.py +23 -0
- package/standard-skills/translate-native/integrations/website_localization.py +234 -10
- package/standard-skills/translate-native/integrations/website_localization_benchmark.py +39 -3
- package/standard-skills/translate-native/integrations/website_localization_cms.py +512 -10
- package/standard-skills/translate-native/integrations/website_localization_cms_client.py +116 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_receiver.py +101 -11
- package/standard-skills/translate-native/integrations/website_localization_cms_receiver_runtime.py +12 -1
- package/standard-skills/translate-native/integrations/website_localization_cms_receiver_store.py +186 -24
- package/standard-skills/translate-native/integrations/website_localization_cms_source_client.py +64 -1
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery.py +528 -5
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_auth.py +918 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_auth_runtime.py +609 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_client.py +885 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_http.py +1244 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_runtime.py +220 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_sidecar_adapter.py +331 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_capabilities_http.py +444 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_client.py +673 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_dispatch.py +1317 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_dispatch_client.py +826 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_dispatch_http.py +1152 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_dispatch_openapi.py +896 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_dispatch_runtime.py +621 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_http.py +1180 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_delivery_submission_runtime.py +1479 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_source_http.py +133 -17
- package/standard-skills/translate-native/integrations/website_localization_cms_source_runtime.py +319 -4
- package/standard-skills/translate-native/integrations/website_localization_cms_source_service.py +72 -2
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_http.py +13 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_receiver.py +56 -13
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_receiver_openapi.py +335 -0
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_notification_receiver_runtime.py +66 -1
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_processing_monitor.py +73 -7
- package/standard-skills/translate-native/integrations/website_localization_cms_terminal_receiver_client.py +93 -9
- package/standard-skills/translate-native/integrations/website_localization_evidence_http.py +221 -11
- package/standard-skills/translate-native/integrations/website_localization_health.py +6 -0
- package/standard-skills/translate-native/integrations/website_localization_http_provider.py +1 -1
- package/standard-skills/translate-native/integrations/website_localization_quality_profiles.py +350 -0
- package/standard-skills/translate-native/integrations/website_localization_queue.py +126 -56
- package/standard-skills/translate-native/integrations/website_localization_receipt_verifier_http.py +166 -13
- package/standard-skills/translate-native/integrations/website_localization_release.py +423 -17
- package/standard-skills/translate-native/integrations/website_localization_release_coordinator.py +168 -13
- package/standard-skills/translate-native/integrations/website_localization_runner.py +10 -0
- package/standard-skills/translate-native/integrations/website_localization_worker.py +213 -9
- package/standard-skills/translate-native/provenance.json +2 -2
- package/standard-skills/translate-native/references/commercial-localization.md +96 -17
- package/standard-skills/translate-native/scripts/blun_language_guard.py +3 -1
- package/standard-skills/translate-native/scripts/check_commercial_review.py +69 -9
- package/standard-skills/translate-native/scripts/commercial_localization_profile.py +829 -31
- package/standard-tools/language-guard/VERSION +1 -1
- package/standard-tools/language-guard/blun_language_guard.py +3 -1
- package/standard-tools/language-guard/check_commercial_review.py +69 -9
- package/standard-tools/language-guard/commercial_localization_profile.py +829 -31
- package/standard-tools/language-guard/provenance.json +2 -2
- package/standard-tools/manifest.json +1 -1
- package/worker-host.mjs +215 -82
- package/agent-spine-plugin/scripts/check-install-king.js +0 -37
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Commercial localization — profile
|
|
1
|
+
# Commercial localization — profile v4
|
|
2
2
|
|
|
3
3
|
Use for pricing pages, offer cards, checkout copy, subscription CTAs, discounts,
|
|
4
4
|
trials and associated conditions in **any language or script**. The skill is
|
|
@@ -57,6 +57,12 @@ a translation to fill a gap. A grammatical target and model confidence alone
|
|
|
57
57
|
are not publication evidence. Neither average scores nor unrelated successful
|
|
58
58
|
checks override a blocking or major defect.
|
|
59
59
|
|
|
60
|
+
For offer-local uncertainty, route the affected review dimension together with
|
|
61
|
+
the offer's zero-based registry position. Keep configured offer identifiers out
|
|
62
|
+
of the content-free summary. The independent model or qualified reviewer must
|
|
63
|
+
resolve that exact ordered scope; never widen, narrow, reorder, or relabel it
|
|
64
|
+
after the source-aware review.
|
|
65
|
+
|
|
60
66
|
## Skill-only evidence check
|
|
61
67
|
|
|
62
68
|
The executable checker and its shared validator ship in this skill's `scripts/`
|
|
@@ -65,10 +71,14 @@ needed for this local check. Run from the skill directory:
|
|
|
65
71
|
|
|
66
72
|
```bash
|
|
67
73
|
python3 scripts/check_commercial_review.py --contract
|
|
68
|
-
python3 scripts/check_commercial_review.py --source source.txt --target target.txt --review review.json
|
|
74
|
+
python3 scripts/check_commercial_review.py --source source.txt --target target.txt --review review.json \
|
|
75
|
+
--target-locale sv-SE \
|
|
76
|
+
--commercial-quality-profile-version commercial-eu-sv-SE-2026-09-2 \
|
|
77
|
+
--commercial-quality-profile-sha256 "${COMMERCIAL_QUALITY_PROFILE_SHA256}"
|
|
69
78
|
```
|
|
70
79
|
|
|
71
|
-
The contract
|
|
80
|
+
The contract response contains the review-input shape plus the content-free,
|
|
81
|
+
hashed summary and resolution contracts; it is not a completed review. First perform the
|
|
72
82
|
source-blind native review, then have the source-aware reviewer produce the
|
|
73
83
|
`commercial_review` object; save that object alone as `review.json`. Do not
|
|
74
84
|
manufacture positive evidence to satisfy the checker. Supply the full unchanged
|
|
@@ -104,27 +114,76 @@ existing `legal` path with required human review; this profile is not a legal
|
|
|
104
114
|
approval. For mixed pages, supply complete contextual commercial units rather
|
|
105
115
|
than isolated price fragments.
|
|
106
116
|
|
|
107
|
-
The planner binds `translate-native.commercial.
|
|
117
|
+
The planner binds `translate-native.commercial.v13` and the exact target-locale
|
|
118
|
+
commercial quality profile into the job and plan IDs.
|
|
108
119
|
The authenticated capabilities response publishes the same profile as a
|
|
109
120
|
separately hashed, brand-neutral machine-readable contract. It lists all ten
|
|
110
121
|
semantic dimensions, exact preservation rules, permitted locale-aware
|
|
111
122
|
rendering, the evidence method and the fail-closed route for ambiguity. CMS
|
|
112
123
|
integrations can therefore preflight the implemented offer contract without
|
|
113
124
|
receiving project prices, product lists, protected terms or deployment secrets.
|
|
114
|
-
Its separately hashed `review_summary_contract` also declares the exact
|
|
125
|
+
Its separately hashed `review_summary_contract` also declares the exact six
|
|
115
126
|
summary fields, both valid statuses, the only permitted ordered dimension
|
|
116
|
-
names, the evidence-
|
|
117
|
-
|
|
127
|
+
names, the exact current review-evidence-contract SHA-256, and the evidence-hash
|
|
128
|
+
canonicalization. The digest input is a versioned binding containing the
|
|
129
|
+
profile, review-evidence-contract digest, target locale, commercial locale-quality
|
|
130
|
+
profile version and digest, exact UTF-8 source and target hashes, and the
|
|
131
|
+
complete evidence. The summary still explicitly excludes source text, target
|
|
132
|
+
text, spans, reviewer prose, project prices and project brands.
|
|
118
133
|
Adapters therefore do not need to infer the targeted-review envelope from a
|
|
119
134
|
schema name or prose. A changed, missing, reordered or unknown dimension makes
|
|
120
135
|
the complete capability response unavailable.
|
|
136
|
+
|
|
137
|
+
Within every dimension, `offer_statuses` must contain exactly one entry for
|
|
138
|
+
every registered offer, in registry order. The dimension-level status is not
|
|
139
|
+
free-form: it is derived with `changed`, `uncertain`, `equivalent`, then
|
|
140
|
+
`not_present` precedence. Each equivalent, changed, or uncertain offer verdict
|
|
141
|
+
must carry evidence located inside that offer's declared regions. This proves
|
|
142
|
+
structural completeness of the review, not semantic truth; uncertain values
|
|
143
|
+
still require an independent model or qualified native-domain reviewer.
|
|
144
|
+
|
|
145
|
+
The separately hashed `review_evidence_contract` is the machine-readable
|
|
146
|
+
source of truth for the private source-fidelity report. It closes the exact
|
|
147
|
+
top-level fields, coverage values, ten dimensions, item relations and limits;
|
|
148
|
+
defines Unicode code-point offsets and offer-region containment; and requires
|
|
149
|
+
one matched assignment per registered offer. It contains no project prices,
|
|
150
|
+
text, spans, brands, or reviewer prose. Its structural validator cannot prove
|
|
151
|
+
semantic truth, and the contract explicitly grants no publication authority.
|
|
152
|
+
The portable `--contract` response exposes this same object.
|
|
153
|
+
|
|
154
|
+
The separately hashed `review_resolution_contract` defines the exact ordered
|
|
155
|
+
dimension acknowledgement and the two permitted resolution methods. A
|
|
156
|
+
qualified-human resolution must omit reviewer provider identity; both methods
|
|
157
|
+
must carry the primary provider's exact ID, model ID and model version. An
|
|
158
|
+
independent-model resolution additionally carries the same fields for the
|
|
159
|
+
second provider, whose provider ID must differ. Each result binds the advertised
|
|
160
|
+
resolution-contract SHA-256 and publishes only the verified receipt SHA-256.
|
|
161
|
+
Raw receipts, credentials, reviewer prose, qualified-human identity, source
|
|
162
|
+
and target text, project prices and project brands remain excluded. The
|
|
163
|
+
release-evidence schema uses the same provider-neutral resolution schema, so a
|
|
164
|
+
consumer does not need to infer these conditional rules from documentation.
|
|
165
|
+
|
|
166
|
+
Every commercial locale profile also carries an exact Unicode CLDR 48 numbers
|
|
167
|
+
reference. Use its resolved locale, numbering system, grouping threshold,
|
|
168
|
+
symbols, and standard decimal, percent, currency, ISO-currency, approximation,
|
|
169
|
+
limit, and range patterns as native rendering guidance. Do not use a surface
|
|
170
|
+
pattern or cross-language regex as evidence that the value is semantically
|
|
171
|
+
equal. Meaning-preserving number words, written percentages, and digit forms
|
|
172
|
+
remain eligible; unresolved values require independent model or qualified
|
|
173
|
+
native-domain review.
|
|
121
174
|
The worker uses the existing three ordered passes; the source-fidelity response
|
|
122
175
|
additionally requires `commercial_review`. It contains all ten named dimensions,
|
|
123
|
-
coverage and per-offer evidence. Each
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
176
|
+
coverage, a canonical offer registry, and per-offer evidence. Each registry
|
|
177
|
+
entry has a unique stable identifier plus ordered, non-overlapping source and
|
|
178
|
+
target regions. Multiple discontiguous regions are allowed for linked footnotes
|
|
179
|
+
and conditions, but regions cannot overlap across offers. Each evidence item
|
|
180
|
+
declares `matched`, `source_only`, or `target_only`, names a registered offer,
|
|
181
|
+
and supplies exact source/target character spans contained in that offer's
|
|
182
|
+
declared regions; the absent side of a one-sided item is `null`. Equivalent
|
|
183
|
+
evidence must be matched, and `offer_assignment` must name every registered
|
|
184
|
+
offer exactly once. A specific changed or uncertain verdict needs a concrete
|
|
185
|
+
item, while globally uncertain coverage may remain span-free rather than
|
|
186
|
+
fabricate a location.
|
|
128
187
|
Missing/malformed checks, impossible relation/span combinations and changed
|
|
129
188
|
terms produce no result or approval. Uncertainty or an all-absent report preserves the candidate only as a
|
|
130
189
|
low-confidence fidelity result. It remains unpublishable until the host verifies
|
|
@@ -133,14 +192,34 @@ model receipt bound to the commercial profile and policy. The worker does not
|
|
|
133
192
|
secretly call an alternative provider.
|
|
134
193
|
|
|
135
194
|
The worker retains a content-free `commercial_review` summary in result schema
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
195
|
+
v8. It contains only the profile, verdict, exact review-evidence-contract
|
|
196
|
+
SHA-256, ordered unresolved dimension names
|
|
197
|
+
and a hash binding the profile, exact source and target hashes, and complete
|
|
198
|
+
commercial evidence. Prices, text spans, interpretations and reviewer prose do
|
|
199
|
+
not survive in the summary. The same
|
|
200
|
+
summary is bound into quality-evidence request schema v12 and receipt-binding
|
|
201
|
+
schema v8, so an independent adapter receives the exact targeted scope and
|
|
141
202
|
cannot replace it with a generic approval. Tampered, unknown, reordered or
|
|
142
203
|
contradictory dimensions block before network access or signing.
|
|
143
204
|
|
|
205
|
+
For a review-required result, the worker also derives the private
|
|
206
|
+
`translate-native.commercial-review-routing.v2` context from the already
|
|
207
|
+
validated offer registry. It maps each zero-based opaque offer index to ordered
|
|
208
|
+
source and target Unicode code-point spans and binds both text lengths. The
|
|
209
|
+
context deliberately strips configured IDs, text, prices, brands, and reviewer
|
|
210
|
+
explanations. It carries the exact digest of the separately advertised,
|
|
211
|
+
machine-readable routing contract, which fixes code-point offsets, exclusive
|
|
212
|
+
ends, complete text lengths, registry-order coverage, overlap rules, and the
|
|
213
|
+
private-only trust boundary. Evidence-request identity and every receipt
|
|
214
|
+
binding cover the route and contract digest;
|
|
215
|
+
span, order, count, or length drift blocks before network access. It never
|
|
216
|
+
appears in public CMS release evidence.
|
|
217
|
+
For unresolved work, the evidence request also includes the complete
|
|
218
|
+
content-free routing contract. The coordinator and HTTPS adapter independently
|
|
219
|
+
reconstruct it, and request identity covers the exact object. Verified
|
|
220
|
+
commercial and non-commercial requests require both route and contract to be
|
|
221
|
+
`null`.
|
|
222
|
+
|
|
144
223
|
The validator checks evidence shape and offsets, **not semantic truth**. A model
|
|
145
224
|
can misinterpret text or omit a fact while claiming completeness. The host's
|
|
146
225
|
independent quality-receipt verifier must inspect the complete request/response
|
|
@@ -176,6 +176,7 @@ def validate_text(
|
|
|
176
176
|
glossary: dict[str, Any] | None = None,
|
|
177
177
|
content_type: str = "prose",
|
|
178
178
|
short_text_reviewed: bool = False,
|
|
179
|
+
require_character_profile: bool = True,
|
|
179
180
|
) -> dict[str, Any]:
|
|
180
181
|
findings: list[Finding] = []
|
|
181
182
|
if not text.strip():
|
|
@@ -200,7 +201,7 @@ def validate_text(
|
|
|
200
201
|
# count real prose characters. Native characters anywhere in the complete
|
|
201
202
|
# text also disprove the specific hypothesis of wholesale ASCII folding.
|
|
202
203
|
profile_prose_solid = sum(1 for character in profile_prose if not character.isspace())
|
|
203
|
-
if (profile and profile_prose_solid >= 200
|
|
204
|
+
if (require_character_profile and profile and profile_prose_solid >= 200
|
|
204
205
|
and not any(character in profile for character in profile_prose)
|
|
205
206
|
and not any(character in profile for character in text)):
|
|
206
207
|
findings.append(Finding(
|
|
@@ -395,6 +396,7 @@ def release_response(arguments: dict[str, Any]) -> dict[str, Any]:
|
|
|
395
396
|
arguments.get("glossary"),
|
|
396
397
|
arguments.get("content_type", "prose"),
|
|
397
398
|
arguments.get("short_text_reviewed") is True,
|
|
399
|
+
require_character_profile=False,
|
|
398
400
|
)
|
|
399
401
|
report["checks"].append("agent-response-native-orthography")
|
|
400
402
|
if not target_is_text:
|
|
@@ -8,10 +8,17 @@ import hashlib
|
|
|
8
8
|
import json
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
|
-
from commercial_localization_profile import
|
|
11
|
+
from commercial_localization_profile import (
|
|
12
|
+
CommercialReviewBlocked,
|
|
13
|
+
public_review_evidence_contract,
|
|
14
|
+
public_review_resolution_contract,
|
|
15
|
+
public_review_summary_contract,
|
|
16
|
+
review_contract,
|
|
17
|
+
validate_review,
|
|
18
|
+
)
|
|
12
19
|
|
|
13
20
|
|
|
14
|
-
PROFILE = "translate-native.commercial.
|
|
21
|
+
PROFILE = "translate-native.commercial.v13"
|
|
15
22
|
MAX_INPUT_BYTES = 2_000_000
|
|
16
23
|
|
|
17
24
|
|
|
@@ -46,21 +53,66 @@ def main(argv=None) -> int:
|
|
|
46
53
|
parser.add_argument("--source", help="complete source text, UTF-8 without BOM")
|
|
47
54
|
parser.add_argument("--target", help="complete target text, UTF-8 without BOM")
|
|
48
55
|
parser.add_argument("--review", help="source-aware review JSON, UTF-8 without BOM")
|
|
56
|
+
parser.add_argument("--target-locale", help="exact BCP-47 target locale")
|
|
57
|
+
parser.add_argument(
|
|
58
|
+
"--commercial-quality-profile-version",
|
|
59
|
+
help="exact target-locale commercial quality-profile version",
|
|
60
|
+
)
|
|
61
|
+
parser.add_argument(
|
|
62
|
+
"--commercial-quality-profile-sha256",
|
|
63
|
+
help="exact target-locale commercial quality-profile SHA-256",
|
|
64
|
+
)
|
|
49
65
|
args = parser.parse_args(argv)
|
|
50
66
|
if args.contract:
|
|
51
|
-
if any((
|
|
67
|
+
if any((
|
|
68
|
+
args.source, args.target, args.review, args.target_locale,
|
|
69
|
+
args.commercial_quality_profile_version,
|
|
70
|
+
args.commercial_quality_profile_sha256,
|
|
71
|
+
)):
|
|
52
72
|
parser.error("--contract cannot be combined with input files")
|
|
53
|
-
print(json.dumps({
|
|
54
|
-
|
|
73
|
+
print(json.dumps({
|
|
74
|
+
"status": "CONTRACT",
|
|
75
|
+
"release_allowed": False,
|
|
76
|
+
"commercial_review": review_contract(PROFILE),
|
|
77
|
+
"commercial_review_evidence_contract": (
|
|
78
|
+
public_review_evidence_contract(PROFILE)
|
|
79
|
+
),
|
|
80
|
+
"commercial_review_summary_contract": (
|
|
81
|
+
public_review_summary_contract(PROFILE)
|
|
82
|
+
),
|
|
83
|
+
"commercial_review_resolution_contract": (
|
|
84
|
+
public_review_resolution_contract(PROFILE)
|
|
85
|
+
),
|
|
86
|
+
}, ensure_ascii=False, sort_keys=True))
|
|
55
87
|
return 0
|
|
56
|
-
if not all((
|
|
57
|
-
|
|
58
|
-
|
|
88
|
+
if not all((
|
|
89
|
+
args.source, args.target, args.review, args.target_locale,
|
|
90
|
+
args.commercial_quality_profile_version,
|
|
91
|
+
args.commercial_quality_profile_sha256,
|
|
92
|
+
)):
|
|
93
|
+
parser.error(
|
|
94
|
+
"--source, --target, --review, --target-locale, "
|
|
95
|
+
"--commercial-quality-profile-version and "
|
|
96
|
+
"--commercial-quality-profile-sha256 are required"
|
|
97
|
+
)
|
|
98
|
+
result = {"schema": "translate-native.commercial-evidence-check.v2",
|
|
59
99
|
"profile": PROFILE, "release_allowed": False}
|
|
60
100
|
try:
|
|
61
101
|
source, target, raw_review = (_read(path) for path in (args.source, args.target, args.review))
|
|
62
102
|
review = json.loads(raw_review, object_pairs_hook=_object, parse_constant=_constant)
|
|
63
|
-
validate_review(
|
|
103
|
+
summary = validate_review(
|
|
104
|
+
review,
|
|
105
|
+
source,
|
|
106
|
+
target,
|
|
107
|
+
PROFILE,
|
|
108
|
+
target_locale=args.target_locale,
|
|
109
|
+
commercial_quality_profile_version=(
|
|
110
|
+
args.commercial_quality_profile_version
|
|
111
|
+
),
|
|
112
|
+
commercial_quality_profile_sha256=(
|
|
113
|
+
args.commercial_quality_profile_sha256
|
|
114
|
+
),
|
|
115
|
+
)
|
|
64
116
|
except CommercialReviewBlocked as error:
|
|
65
117
|
result.update(status="BLOCK", reason=error.code)
|
|
66
118
|
except (OSError, ValueError, RecursionError):
|
|
@@ -68,6 +120,14 @@ def main(argv=None) -> int:
|
|
|
68
120
|
else:
|
|
69
121
|
result.update(
|
|
70
122
|
status="EVIDENCE_VALID", reason="independent_quality_and_signed_release_required",
|
|
123
|
+
target_locale=args.target_locale,
|
|
124
|
+
commercial_quality_profile_version=(
|
|
125
|
+
args.commercial_quality_profile_version
|
|
126
|
+
),
|
|
127
|
+
commercial_quality_profile_sha256=(
|
|
128
|
+
args.commercial_quality_profile_sha256
|
|
129
|
+
),
|
|
130
|
+
evidence_sha256=summary["evidence_sha256"],
|
|
71
131
|
source_sha256=hashlib.sha256(source.encode("utf-8")).hexdigest(),
|
|
72
132
|
target_sha256=hashlib.sha256(target.encode("utf-8")).hexdigest(),
|
|
73
133
|
review_sha256=hashlib.sha256(raw_review.encode("utf-8")).hexdigest(),
|