compliance

v0.4.0
com.yaktool/compliance Checked 2 days ago Published 2 months ago

GPSR, EUDR plots, nutrition labels, fragrance allergens, CPSC and EU conformity declarations.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

check_gpsr_listing Check a listing against Article 19 of the EU GPSR

Check listing text against the four things Article 19 of Regulation (EU) 2023/988 requires an online offer to show, using 18 documented rules. Applies to anything sold into the EU since 13 December 2024. The four elements are judged SEPARATELY and returned as elements[] with a status each (ok / problem / missing / manual): (1) manufacturer name plus a postal AND an electronic address; (2) a responsible person established in the Union, required when the manufacturer is not; (3) information identifying the product (model, type, batch, GTIN); (4) warnings and safety information in the language of…

ParameterTypeDescription
text *stringThe listing text — title, description and whatever compliance block exists. Paste it raw.
marketsarrayTarget market country codes (e.g. ["DE","FR"]). Without them no judgement is made about warning languages.

check_eudr_geojson Pre-check EUDR plot geolocation before a DDS submission

Check an EUDR geolocation file against 24 rules taken from the European Commission's "EUDR GeoJSON File Description" — including the chapter of common file errors the Commission itself publishes. Due Diligence Statements are rejected for geometry far more often than for anything legal. Catches: unclosed polygon rings, rings with fewer than four positions, self-intersecting boundaries, polygons with holes, collinear coordinates that enclose no area, coordinates out of range (usually un-converted UTM metres), longitude/latitude written the wrong way round, coordinates that collapse into duplic…

ParameterTypeDescription
geojson *stringThe GeoJSON file contents as text (a FeatureCollection, or a single Feature).
fileSizeBytesnumberReal file size in bytes when known, for the 25 MB submission limit; otherwise it is computed from the text.

check_nutrition_facts Round nutrient values for a US Nutrition Facts panel and check them

Turn unrounded laboratory values into the numbers 21 CFR 101.9 requires on a US Nutrition Facts panel, and check any already-declared values against them (8 documented rules). FDA ROUNDING IS NOT ORDINARY ROUNDING and this is the whole point of the tool: total fat goes to the nearest 0.5 g below 5 g and the nearest 1 g above; sodium to the nearest 5 mg up to 140 mg and 10 mg above; calories to the nearest 5 up to 50 and 10 above; cholesterol under 2 mg may be zero and 2-5 mg may be stated as "less than 5 mg"; gram nutrients under 1 g may be stated as "less than 1 g". A value passed through Mat…

ParameterTypeDescription
measured *objectUnrounded lab values keyed by nutrient: calories, totalFat, saturatedFat, transFat, cholesterol, sodium, totalCarbohydrate, dietaryFiber, totalSugars, addedSugars, protein.
declaredobjectValues already printed on the label, same keys — each is compared with the required rounding.
declaredPercentobjectPercent Daily Values already printed, same keys.

round_nutrient_value Round one nutrient value the way FDA requires

Round a single nutrient value per 21 CFR 101.9 and say which rule band was used. Returns { display, value, rule } — `display` is what goes on the label and may be a phrase such as "less than 1 g" rather than a number, in which case `value` is null. Use this when composing a label value by value; use check_nutrition_facts for a whole panel with its consistency checks.

ParameterTypeDescription
nutrient *stringWhich nutrient — each has its own increments.
value *numberThe unrounded amount per serving, in the unit for that nutrient (g, mg or kcal).

check_fragrance_allergens Work out which fragrance allergens must be named in an EU ingredient list

Convert a supplier's allergen certificate into concentrations in the finished cosmetic product and decide which substances must be named individually in the ingredient list (8 documented rules). THE ARITHMETIC IS THE POINT. A certificate says "4.2% Linalool" — that is 4.2% OF THE FRAGRANCE COMPOUND, not of the product. Dose the compound at 0.8% and the product contains 0.0336%, which is 33x the leave-on threshold. Dose it at 0.01% and the same certificate gives 0.00042%, below it. Comparing the certificate figure directly against the threshold gets both cases wrong, and it is the most common…

ParameterTypeDescription
allergens *arrayThe certificate rows: INCI name and its percentage WITHIN the fragrance compound.
compoundPercent *numberHow much fragrance compound the formula contains, as a percentage of the finished product.
ingredientListstringThe ingredient list as printed, to check that declarable allergens are actually named in it.
productTypestringLeave-on (0.001%) or rinse-off (0.01%). Omit and the stricter threshold is used, which the result states.

check_eu_nutrition_declaration Check an EU nutrition declaration against Regulation 1169/2011

Check a nutrition declaration for an EU pack against 13 documented rules, and return the range an official control accepts for every declared value. Pass `text` with the declaration EXACTLY as printed — the order of the lines is itself checked, and so is the presence of rows the declaration may not contain. Or pass `declared` for a structured call; both go through the same rules. THE ENERGY ROW IS THE POINT. Annex XIV gives kJ and kcal as two independent factor columns (carbohydrate 17 kJ/g AND 4 kcal/g; fat 37 and 9), so the kcal figure is NOT the kJ figure divided by 4.184 — that shortcu…

ParameterTypeDescription
basisstringOverrides the basis read from the text.
declaredobjectStructured alternative to `text`: energyKj, energyKcal, fat, saturates, monounsaturates, polyunsaturates, carbohydrate, sugars, polyols, starch, fibre, protein, salt, sodium — grams per 100 g.
measuredobjectUnrounded laboratory values by the same keys, to drive the tolerance check and show what the label must print.
textstringThe declaration as printed, one nutrient per line. Needed for the order and forbidden-row checks.

eu_nutrition_tolerance Work out the range an official control accepts for one declared value

Take one value as printed on an EU label and return the range an official control accepts for it, with the working. This is a THREE-STEP calculation and neither shortcut is right: it is not "declared ± 20%", and the band is not applied to the declared figure. The guidance first widens the printed number back to every value that would round to it (8.5 becomes 8.45 to 8.54 — the number of decimals you printed decides this, so pass `decimals` if the printed form has trailing zeros), then applies the tolerance band for that nutrient AT THAT LEVEL, then rounds both ends back per the rounding gui…

ParameterTypeDescription
declared *numberThe value as printed on the label, in grams per 100 g.
nutrient *stringWhich nutrient — the band and the rounding tier both depend on it.
decimalsnumberHow many decimals were printed, when that differs from the number itself (0.50 rather than 0.5). It changes the range.

check_cpsc_certificate Check a US CPSC certificate of compliance (CPC or GCC) against 16 CFR 1110

Check a Children's Product Certificate or General Certificate of Conformity against the 12 elements 16 CFR Part 1110 requires. THE TEXT YOU ARE PROBABLY REMEMBERING IS OUT OF DATE. The eFiling final rule rewrote § 1110.11 and has been in force since 2026-07-08; almost every template and guidance article in circulation — and the CFR annual-edition snapshots — still describe the 2008 text. Three differences decide most failures: (1) a unique identifier is now mandatory (GTIN, model number, registered number, serial number, SKU, UPC or an alternate identifier) where a description used to be…

ParameterTypeDescription
text *stringThe certificate as written, one field per line (for example "Certifier: ...", "Records custodian: ...", "Manufactured: ...", "Tested: ...").
efiledbooleanTrue when this certificate is eFiled — the attestation then comes from the Product Registry and CATAIR rather than the document, so it is not required in the text.
importedbooleanWhether the goods are imported. Inferred from the place of manufacture when omitted; it decides who § 1110.7 puts on the certificate.

check_eu_declaration_of_conformity Check an EU/EC Declaration of Conformity against the annex that actually applies

Check a Declaration of Conformity against the numbered items its applicable annex requires, using 14 documented rules across 8 annexes taken from the primary EUR-Lex texts. DO NOT CHECK IT AGAINST "THE EIGHT ELEMENTS". Those eight are Annex III of Decision 768/2008/EC, which is a MODEL that sector legislation adapts; the annex that binds a product is the one in its own directive, and they differ in ways that produce FALSE POSITIVES if you use the generic list: (1) Annex IV of the LVD (2014/35/EU) and Annex VI of RoHS (2011/65/EU) have NO NOTIFIED BODY ITEM AT ALL — conformity there rests on…

ParameterTypeDescription
text *stringThe declaration as written, ideally keeping its numbered items on separate lines.
directivesarrayOverride which annexes to check against. Omit to use the directives the declaration itself cites — that is the normal path.