diff --git a/README.md b/README.md index 49f21744..d668d1a7 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ code imply, each marked **detected (file:line)** or **ask owner**, as a diff aga the config. Nothing is written unless you run `storebound scan --write` (only detected answers; questions stay questions). The MCP tool `scan` is read-only and cannot write; `validate` includes the open scan findings; the desktop app shows them on the Checks tab. A finding you decided is fine goes into the config with its reason: -`scan: { ignore: [{ rule: 'demo-account', reason: '...' }] }`. +`scan: { ignore: [{ rule: 'demo-account', reason: '...' }] }`; a rule with several checks (e.g. `play-metadata`) takes `match: ''` to accept just one of them. | rule | App Store | Google Play | what scan proves | |---|---|---|---| diff --git a/cli/lib/config.ts b/cli/lib/config.ts index 025b179b..87227eee 100644 --- a/cli/lib/config.ts +++ b/cli/lib/config.ts @@ -537,7 +537,7 @@ export interface ShipConfig { * them in App Store Connect). `storebound scan` proposes them from the detected SDKs and code. */ appPrivacy?: AppPrivacyConfig; /** `storebound scan`: findings the owner has looked at and accepts, by rule id (with the reason, shown in the report). */ - scan?: { ignore?: { rule: string; store?: 'apple' | 'play'; reason: string }[] }; + scan?: { ignore?: { rule: string; store?: 'apple' | 'play'; /** Only findings whose title contains this text (one check of a rule that has several). */ match?: string; reason: string }[] }; /** Ads: `validate` checks that /app-ads.txt is reachable and contains every line listed here. */ ads?: { appAdsTxt?: string[] }; /** Rendered store graphics dir (///NN.png|jpg). Defaults to shots.out. */ @@ -766,8 +766,8 @@ export function validateConfig(c: unknown): string[] { e.push('appPrivacy.trackingDomains: a list of host names'); } for (const [i, x] of (cfg.scan?.ignore ?? []).entries()) - if (!x || typeof x.rule !== 'string' || !x.rule || typeof x.reason !== 'string' || !x.reason.trim() || (x.store !== undefined && x.store !== 'apple' && x.store !== 'play')) - e.push(`scan.ignore[${i}]: { rule: '', reason: 'why this is fine', store?: 'apple' | 'play' }`); + if (!x || typeof x.rule !== 'string' || !x.rule || typeof x.reason !== 'string' || !x.reason.trim() || (x.store !== undefined && x.store !== 'apple' && x.store !== 'play') || (x.match !== undefined && (typeof x.match !== 'string' || !x.match.trim()))) + e.push(`scan.ignore[${i}]: { rule: '', reason: 'why this is fine', store?: 'apple' | 'play', match?: '' }`); if (cfg.ads?.appAdsTxt && !cfg.ads.appAdsTxt.every(l => typeof l === 'string' && l.split(',').length >= 3)) e.push('ads.appAdsTxt: lines like "example-network.com, pub-123, DIRECT, abc123"'); const seen = new Set(); diff --git a/cli/lib/scan/index.ts b/cli/lib/scan/index.ts index 7314e650..bed6ee07 100644 --- a/cli/lib/scan/index.ts +++ b/cli/lib/scan/index.ts @@ -149,7 +149,7 @@ export function addOriginality(r: ScanReport, o: OriginalityReport, stores: { ap if (stores.play) r.findings.push({ ...base, guideline: 'Play: Repetitive content', store: 'play', ref: 'https://support.google.com/googleplay/android-developer/answer/9898783' }); } for (const f of r.findings) if (f.rule === 'originality' && !f.accepted) { - const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store)); + const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store) && (!i.match || f.title.toLowerCase().includes(i.match.toLowerCase()))); if (hit) f.accepted = hit.reason; } r.findings = sortScan(r.findings); diff --git a/cli/lib/scan/rules.ts b/cli/lib/scan/rules.ts index 28987a7d..11084274 100644 --- a/cli/lib/scan/rules.ts +++ b/cli/lib/scan/rules.ts @@ -516,7 +516,7 @@ export function scanRules(inp: ScanInput): ScanFinding[] { // ---- owner-accepted findings ---- const ignore = c?.scan?.ignore ?? []; for (const f of out) { - const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store)); + const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store) && (!i.match || f.title.toLowerCase().includes(i.match.toLowerCase()))); if (hit) f.accepted = hit.reason; } return sortScan(out); diff --git a/skills/store-preflight/SKILL.md b/skills/store-preflight/SKILL.md index ed90252f..c2407087 100644 --- a/skills/store-preflight/SKILL.md +++ b/skills/store-preflight/SKILL.md @@ -17,7 +17,7 @@ the stores; run them freely. Privacy / ATT / privacy manifest proposal, each item "detected (file:line)" or "ask owner", as a diff against the config. Exit 1 on an open blocker. `--write` adds only the detected answers to the config (show the diff and ask the owner first; MCP never writes). `--store apple|play`, `--json`. A finding the owner accepts goes into - `scan.ignore: [{ rule, reason }]`; never add one without the owner's reason. The Play rules also read + `scan.ignore: [{ rule, reason, match? }]` (`match` = text in the finding title, to accept one check of a rule with several); never add one without the owner's reason. The Play rules also read `play.targetAges` (Families), `play.accountType` / `play.accountCreated` (closed-testing requirement) and `play.billingPrograms` (payments): ask the owner for them, never guess. 1. `storebound check`: config, both listing files (limits are checked locally: title 30, subtitle 30, keywords 100 diff --git a/tests/scan.test.ts b/tests/scan.test.ts index 23736c89..d0e861ff 100644 --- a/tests/scan.test.ts +++ b/tests/scan.test.ts @@ -240,6 +240,11 @@ describe('Google Play rules', () => { const soft = await scanVariant('play-listing', { 'store/listing.md': s => s.replace('🔥 #1 Best Free Photo Saver App Pro', 'Free Photo Saver') }); expect(soft.findings.filter(f => f.rule === 'play-metadata' && f.title.includes('Free Photo Saver')).map(f => f.severity)).toEqual(['low']); expect(rules(await scan('ios-native').then(x => x.findings), 'play').size).toBe(0); + // scan.ignore with match: accepts the ALL CAPS check of play-metadata only, the other metadata checks stay open + const caps = await scanVariant('play-listing', { 'storebound.config.ts': s => s.replace(/\n(\s*)app: \{/, "\n$1scan: { ignore: [{ rule: 'play-metadata', match: 'ALL CAPS', reason: 'brand name' }] },\n$1app: {") }); + const md = caps.findings.filter(f => f.rule === 'play-metadata'); + expect(md.find(f => f.title.includes('ALL CAPS'))!.accepted).toBe('brand name'); + expect(md.filter(f => !f.title.includes('ALL CAPS')).every(f => !f.accepted)).toBe(true); }); test('the policy tables cite their sources', () => { for (const u of Object.values(PLAY_REFS)) expect(u).toMatch(/^https:\/\//);