← back to Gmc Titlefix
TK-10993 Track G: read-only policy-disapproval enumerator
9b6af59805853076b72d700d29b9657c95d027bb · 2026-09-04 09:27:59 -0700 · Steve
Splits US policy disapprovals by code, dedupes per-attribute duplicate issue
rows, and tests each title against known colorway trigger words so the
'false positive from a DW colour name' claim is checked per-offer rather than
assumed. Read-only.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwqETbc3v7wsu6qNtfgkdx
Files touched
A tk10993-track-g-enumerate.mjs
Diff
commit 9b6af59805853076b72d700d29b9657c95d027bb
Author: Steve <steve@designerwallcoverings.com>
Date: Fri Sep 4 09:27:59 2026 -0700
TK-10993 Track G: read-only policy-disapproval enumerator
Splits US policy disapprovals by code, dedupes per-attribute duplicate issue
rows, and tests each title against known colorway trigger words so the
'false positive from a DW colour name' claim is checked per-offer rather than
assumed. Read-only.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DwqETbc3v7wsu6qNtfgkdx
---
tk10993-track-g-enumerate.mjs | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/tk10993-track-g-enumerate.mjs b/tk10993-track-g-enumerate.mjs
new file mode 100644
index 0000000..3862df7
--- /dev/null
+++ b/tk10993-track-g-enumerate.mjs
@@ -0,0 +1,33 @@
+// TK-10993 Track G — enumerate the US policy-violation disapprovals so the
+// false-positive claim can be checked per-offer instead of assumed. READ-ONLY.
+import { createRequire } from 'module'; import fs from 'fs';
+const require = createRequire('file:///Users/macstudio3/Projects/gmc-titlefix/');
+const { token, MERCHANT } = require('/Users/macstudio3/Projects/gmc-titlefix/_auth.js');
+const tok = await token(); const H = { Authorization: 'Bearer ' + tok };
+const POLICY = /_policy_violation$/;
+let page='', scanned=0; const hits=[];
+do {
+ const r = await fetch(`https://shoppingcontent.googleapis.com/content/v2.1/${MERCHANT}/productstatuses?maxResults=250${page?`&pageToken=${page}`:''}`,{headers:H,signal:AbortSignal.timeout(60000)});
+ const j = await r.json(); if (j.error) { console.error('ERR',j.error.message); break; }
+ for (const p of (j.resources||[])) { scanned++;
+ for (const i of (p.itemLevelIssues||[])) {
+ if (i.servability==='disapproved' && POLICY.test(i.code) && (i.applicableCountries||[]).includes('US'))
+ hits.push({ id:p.productId, title:p.title||'', code:i.code, detail:i.detail||'', attr:i.attributeName||'' });
+ } }
+ page = j.nextPageToken||'';
+} while (page);
+// which policy-trigger words actually appear in the title?
+const TRIGGERS = ['tobacco','champagne','pussy willow','whiskey','whisky','bourbon','gin','vodka','rum','opium','cannabis','hemp','smoke','cigar','absinthe','poppy','gun','pistol','bullet'];
+const byCode={}, withTrigger=[], withoutTrigger=[];
+for (const h of hits) {
+ byCode[h.code]=(byCode[h.code]||0)+1;
+ const t=h.title.toLowerCase(); const found=TRIGGERS.filter(w=>t.includes(w));
+ (found.length ? withTrigger : withoutTrigger).push({...h, matched:found});
+}
+const out={ snapshot_at:new Date().toISOString(), scanned, policy_disapprovals:hits.length, by_code:byCode,
+ title_contains_known_colorway_trigger:withTrigger.length, no_trigger_in_title:withoutTrigger.length,
+ trigger_word_counts:Object.fromEntries(Object.entries(withTrigger.reduce((a,h)=>{h.matched.forEach(w=>a[w]=(a[w]||0)+1);return a;},{})).sort((a,b)=>b[1]-a[1])),
+ samples_with_trigger:withTrigger.slice(0,8).map(h=>`${h.code} | ${h.matched} | ${h.title.slice(0,60)}`),
+ samples_without_trigger:withoutTrigger.slice(0,8).map(h=>`${h.code} | ${h.title.slice(0,60)}`) };
+fs.writeFileSync('/Users/macstudio3/.claude/yolo-queue/tk10993-trackF-exec/track-g-policy-offers.json', JSON.stringify({...out, all:hits},null,1));
+console.log(JSON.stringify(out,null,2));
← 9feab81 TK-10993: read-only US disapproval snapshot by issue code
·
back to Gmc Titlefix
·
TK-11233 B3: Kravet-family hi-res re-fetch canary (read-only 4e97f12 →