From 97e4e3e25265c405b3097d9a1450427a88c5edac Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:35:14 +0900 Subject: [PATCH 1/6] feat(release): verify workdays exclusive UI and localized FAQ in production HTML --- .../scripts/check-live-workdays-exclusive.mjs | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 site/scripts/check-live-workdays-exclusive.mjs diff --git a/site/scripts/check-live-workdays-exclusive.mjs b/site/scripts/check-live-workdays-exclusive.mjs new file mode 100644 index 00000000..a584bdc6 --- /dev/null +++ b/site/scripts/check-live-workdays-exclusive.mjs @@ -0,0 +1,84 @@ +#!/usr/bin/env node +/** + * Public, read-only release proof for the new inclusive/exclusive Workdays UX. + * Merging source files is not proof the content is actually served. + * Usage: node scripts/check-live-workdays-exclusive.mjs [https://toolify365.com] + */ +import { resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +export const TARGETS = [ + { locale:"en", label:"Exclude start and end dates", mode:"N workdays from a date", faq:"not always 2" }, + { locale:"ja", label:"開始日・終了日を除いて数える", mode:"○営業日後の日付", faq:"一律に2日" }, + { locale:"es", label:"Excluir fechas inicial y final", mode:"N días hábiles desde una fecha", faq:"no siempre 2" }, + { locale:"ar", label:"استبعاد تاريخي البداية والنهاية", mode:"N يوم عمل بعد تاريخ", faq:"ولا تطرح 2" }, +]; + +export function attr(tag, name) { + const match = [...tag.matchAll(/\b([A-Za-z_:][-A-Za-z0-9_:]*)\s*=\s*(["'])(.*?)\2/gs)] + .find(m => m[1].toLowerCase() === name.toLowerCase()); + return match?.[3] ?? ""; +} + +export function visibleText(html) { + const text = html.replace(/]*>[\s\S]*?<\/script>/gi,"") + .replace(/]*>[\s\S]*?<\/style>/gi,"") + .replace(//g,"") + .match(/]*>([\s\S]*?)<\/body>/i)?.[1] ?? ""; + return text.replace(/<[^>]+>/g," ") + .replace(/&/gi,"&").replace(/</gi,"<").replace(/>/gi,">") + .replace(/"/gi,'"').replace(/&#(?:39|x27);/gi,"'") + .replace(/\s+/g," ").trim(); +} + +export function inspectWorkdaysHtml(html, item, origin="https://toolify365.com") { + const errors = []; + const path = "/" + item.locale + "/tools/workdays-calculator"; + const body = visibleText(html); + if (!body) errors.push("VISIBLE_BODY_MISSING"); + for (const [code,phrase] of [ + ["NEW_CHECKBOX_NOT_VISIBLE",item.label], + ["EXISTING_ADD_MODE_NOT_VISIBLE",item.mode], + ["CORRECTED_BOUNDARY_FAQ_NOT_VISIBLE",item.faq], + ]) if (!body.includes(phrase)) errors.push(code); + const htmlTag=html.match(/]*>/i)?.[0] ?? ""; + if (attr(htmlTag,"lang").toLowerCase()!==item.locale.toLowerCase()) errors.push("WRONG_HTML_LANG"); + const canonicalTags=[...html.matchAll(/]*>/gi)].map(m=>m[0]).filter(tag=>attr(tag,"rel").toLowerCase()==="canonical"); + const canonical = attr(canonicalTags[0]??"","href"); + try { + const value = new URL(canonical,origin); + if (canonicalTags.length!==1 || value.origin!==origin || value.pathname.replace(/\/$/,"")!==path) + errors.push("WRONG_CANONICAL"); + } catch { errors.push("INVALID_CANONICAL"); } + const title=[...html.matchAll(/]*>[\s\S]*?<\/title>/gi)]; + if (title.length!==1) errors.push("TITLE_MISSING_OR_DUPLICATE"); + if (item.locale==="en" || item.locale==="ja") { + const robots=[...html.matchAll(/]*>/gi)].map(m=>m[0]).filter(tag=>attr(tag,"name").toLowerCase()==="robots"); + if (robots.some(tag=>/(?:^|[,;\s])noindex(?:$|[,;\s])/i.test(attr(tag,"content")))) + errors.push("INDEXABLE_LOCALE_UNEXPECTED_NOINDEX"); + } + return {ok:errors.length===0,errors,canonical}; +} + +export async function run(url=process.argv[2]||"https://toolify365.com") { + const root=new URL(url); + if (root.pathname!=="/" || root.search || root.hash || root.username || root.password) throw Error("Origin only"); + if (root.hostname!=="toolify365.com" && root.hostname!=="localhost") throw Error("Unexpected host"); + if(root.protocol!=="https:" && root.hostname!=="localhost") throw Error("HTTPS is required"); + const results=[]; + for(const item of TARGETS){ + const path="/" + item.locale + "/tools/workdays-calculator",url=root.origin+path; + try{ + const response=await fetch(url,{redirect:"follow",headers:{"Cache-Control":"no-cache","User-Agent":"Toolify365WorkdayReleaseVerifier/1.0","Accept-Language":item.locale},signal:AbortSignal.timeout(16000)}); + if(!response.ok)throw Error("HTTP "+response.status); + const actual=new URL(response.url); + if(actual.origin!==root.origin || actual.pathname.replace(/\/$/,"")!==path)throw Error("UNEXPECTED_REDIRECT: "+response.url); + const proof=inspectWorkdaysHtml(await response.text(),item,root.origin); + results.push({url,status:response.status,...proof}); + }catch(e){results.push({url,ok:false,errors:[e.message||String(e)]});} + } + console.log(JSON.stringify({checkedAt:new Date().toISOString(),kind:"read_only_public_release_proof",results},null,2)); + if(results.some(x=>!x.ok))process.exitCode=1; + return results; +} +if (process.argv[1]&&resolve(process.argv[1])===fileURLToPath(import.meta.url)) run().catch(e=>{console.error(e);process.exitCode=1;}); From 19cb87ca97a802b1e9cf18149aaf576600a88d06 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:35:17 +0900 Subject: [PATCH 2/6] test(release): reject stale SSR, wrong canonical and script-only proof --- .../check-live-workdays-exclusive.test.mjs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 site/scripts/check-live-workdays-exclusive.test.mjs diff --git a/site/scripts/check-live-workdays-exclusive.test.mjs b/site/scripts/check-live-workdays-exclusive.test.mjs new file mode 100644 index 00000000..6007ff45 --- /dev/null +++ b/site/scripts/check-live-workdays-exclusive.test.mjs @@ -0,0 +1,37 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { TARGETS, inspectWorkdaysHtml, visibleText } from "./check-live-workdays-exclusive.mjs"; + +const fixture = item => ''+ + 'Workdays Calculator | Toolify365'+ + ''+ + '
'+ + '
FAQ

'+item.faq+'

'; + +test("only four representative locales checked, index policy remains locale scoped",()=>{ + assert.deepEqual(TARGETS.map(x=>x.locale),["en","ja","es","ar"]); + assert.equal(new Set(TARGETS.map(x=>x.locale)).size,4); +}); +for(const item of TARGETS) { + test(item.locale+": rendered and canonical page accepted",()=>assert.equal(inspectWorkdaysHtml(fixture(item),item).ok,true)); + test(item.locale+": stale FAQ or absent checkbox rejected",()=>{ + const x=fixture(item); + assert.ok(inspectWorkdaysHtml(x.replace(item.faq,"old inaccurate advice"),item).errors.includes("CORRECTED_BOUNDARY_FAQ_NOT_VISIBLE")); + assert.ok(inspectWorkdaysHtml(x.replace(item.label,"missing label"),item).errors.includes("NEW_CHECKBOX_NOT_VISIBLE")); + assert.ok(inspectWorkdaysHtml(x.replace('rel="canonical"','rel="alternate"'),item).errors.includes("WRONG_CANONICAL")); + assert.ok(inspectWorkdaysHtml(x.replace('lang="'+item.locale+'"','lang="other"'),item).errors.includes("WRONG_HTML_LANG")); + }); +} +test("script and style contents cannot spoof visible checkbox/FAQ",()=>{ + const item=TARGETS[0],x=fixture(item); + const bad=x.replace(''+item.label+'','old state') + .replace('

'+item.faq+'

','

wrong FAQ

') + .replace('',''); + assert.ok(!visibleText(bad).includes(item.label)); + assert.ok(inspectWorkdaysHtml(bad,item).errors.includes("NEW_CHECKBOX_NOT_VISIBLE")); + assert.ok(inspectWorkdaysHtml(bad,item).errors.includes("CORRECTED_BOUNDARY_FAQ_NOT_VISIBLE")); +}); +test("noindex cannot pass for an index-eligible core locale",()=>{ + const item=TARGETS[0],html=fixture(item).replace('',''); + assert.ok(inspectWorkdaysHtml(html,item).errors.includes("INDEXABLE_LOCALE_UNEXPECTED_NOINDEX")); +}); From c9447a9b50fdbccfa19c4b3f87456599203174da Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:35:21 +0900 Subject: [PATCH 3/6] chore(release): expose non-mutating live workdays publication proof --- site/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/package.json b/site/package.json index 702726a0..843d4bae 100644 --- a/site/package.json +++ b/site/package.json @@ -30,7 +30,9 @@ "audit:nattzy-cta": "node scripts/check-nattzy-cta.mjs", "test:nattzy-cta": "node --test scripts/check-nattzy-cta.test.mjs", "audit:nattzy-timezone": "node scripts/check-nattzy-cta.mjs --timezone", - "test:workdays-faq": "node --test scripts/workdays-faq-parity.test.mjs" + "test:workdays-faq": "node --test scripts/workdays-faq-parity.test.mjs", + "audit:live-workdays-exclusive": "node scripts/check-live-workdays-exclusive.mjs", + "test:live-workdays-exclusive": "node --test scripts/check-live-workdays-exclusive.test.mjs" }, "dependencies": { "@types/qrcode": "^1.5.6", From 1b21bb5347940ad05e23e6066eee998d9acdb8f6 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:36:19 +0900 Subject: [PATCH 4/6] test(release): require actual checkbox markup and reject HTTP noindex header --- site/scripts/check-live-workdays-exclusive.mjs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/site/scripts/check-live-workdays-exclusive.mjs b/site/scripts/check-live-workdays-exclusive.mjs index a584bdc6..7abc0733 100644 --- a/site/scripts/check-live-workdays-exclusive.mjs +++ b/site/scripts/check-live-workdays-exclusive.mjs @@ -36,6 +36,13 @@ export function inspectWorkdaysHtml(html, item, origin="https://toolify365.com") const path = "/" + item.locale + "/tools/workdays-calculator"; const body = visibleText(html); if (!body) errors.push("VISIBLE_BODY_MISSING"); + // A mention in FAQ text alone must not masquerade as a real checkbox. + const markup=html.replace(/]*>[\\s\\S]*?<\\/script>/gi,"") + .replace(/]*>[\\s\\S]*?<\\/style>/gi,"") + .match(/]*>([\\s\\S]*?)<\\/body>/i)?.[1] ?? ""; + const checkboxLabel=[...markup.matchAll(/]*>([\\s\\S]*?)<\\/label>/gi)] + .some(m=>/]*type=(["'])checkbox\\1/i.test(m[1]) && m[1].includes(item.label)); + if(!checkboxLabel) errors.push("CHECKBOX_CONTROL_NOT_RENDERED"); for (const [code,phrase] of [ ["NEW_CHECKBOX_NOT_VISIBLE",item.label], ["EXISTING_ADD_MODE_NOT_VISIBLE",item.mode], @@ -74,6 +81,10 @@ export async function run(url=process.argv[2]||"https://toolify365.com") { const actual=new URL(response.url); if(actual.origin!==root.origin || actual.pathname.replace(/\/$/,"")!==path)throw Error("UNEXPECTED_REDIRECT: "+response.url); const proof=inspectWorkdaysHtml(await response.text(),item,root.origin); + if ((item.locale==="en" || item.locale==="ja") && /\\bnoindex\\b/i.test(response.headers.get("x-robots-tag")||"")) { + proof.errors.push("INDEXABLE_LOCALE_HTTP_NOINDEX"); + proof.ok=false; + } results.push({url,status:response.status,...proof}); }catch(e){results.push({url,ok:false,errors:[e.message||String(e)]});} } From ae91ae04cd9fd3dcf39497a75b54b7b2c2358364 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:36:22 +0900 Subject: [PATCH 5/6] test(release): fail if FAQ mentions feature but SSR checkbox is absent --- site/scripts/check-live-workdays-exclusive.test.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/site/scripts/check-live-workdays-exclusive.test.mjs b/site/scripts/check-live-workdays-exclusive.test.mjs index 6007ff45..e0290728 100644 --- a/site/scripts/check-live-workdays-exclusive.test.mjs +++ b/site/scripts/check-live-workdays-exclusive.test.mjs @@ -18,6 +18,7 @@ for(const item of TARGETS) { const x=fixture(item); assert.ok(inspectWorkdaysHtml(x.replace(item.faq,"old inaccurate advice"),item).errors.includes("CORRECTED_BOUNDARY_FAQ_NOT_VISIBLE")); assert.ok(inspectWorkdaysHtml(x.replace(item.label,"missing label"),item).errors.includes("NEW_CHECKBOX_NOT_VISIBLE")); + assert.ok(inspectWorkdaysHtml(x.replace('',''),item).errors.includes("CHECKBOX_CONTROL_NOT_RENDERED")); assert.ok(inspectWorkdaysHtml(x.replace('rel="canonical"','rel="alternate"'),item).errors.includes("WRONG_CANONICAL")); assert.ok(inspectWorkdaysHtml(x.replace('lang="'+item.locale+'"','lang="other"'),item).errors.includes("WRONG_HTML_LANG")); }); From 270954d4b9a7b8f8106d40903877bbced8a72d1f Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Sat, 14 Nov 2026 18:37:18 +0900 Subject: [PATCH 6/6] fix(release): ensure actual HTML checkbox regexes match, not literal backslashes --- site/scripts/check-live-workdays-exclusive.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/site/scripts/check-live-workdays-exclusive.mjs b/site/scripts/check-live-workdays-exclusive.mjs index 7abc0733..7054bad0 100644 --- a/site/scripts/check-live-workdays-exclusive.mjs +++ b/site/scripts/check-live-workdays-exclusive.mjs @@ -37,11 +37,11 @@ export function inspectWorkdaysHtml(html, item, origin="https://toolify365.com") const body = visibleText(html); if (!body) errors.push("VISIBLE_BODY_MISSING"); // A mention in FAQ text alone must not masquerade as a real checkbox. - const markup=html.replace(/]*>[\\s\\S]*?<\\/script>/gi,"") - .replace(/]*>[\\s\\S]*?<\\/style>/gi,"") - .match(/]*>([\\s\\S]*?)<\\/body>/i)?.[1] ?? ""; - const checkboxLabel=[...markup.matchAll(/]*>([\\s\\S]*?)<\\/label>/gi)] - .some(m=>/]*type=(["'])checkbox\\1/i.test(m[1]) && m[1].includes(item.label)); + const markup=html.replace(/]*>[\s\S]*?<\/script>/gi,"") + .replace(/]*>[\s\S]*?<\/style>/gi,"") + .match(/]*>([\s\S]*?)<\/body>/i)?.[1] ?? ""; + const checkboxLabel=[...markup.matchAll(/]*>([\s\S]*?)<\/label>/gi)] + .some(m=>/]*type=(["'])checkbox\1/i.test(m[1]) && m[1].includes(item.label)); if(!checkboxLabel) errors.push("CHECKBOX_CONTROL_NOT_RENDERED"); for (const [code,phrase] of [ ["NEW_CHECKBOX_NOT_VISIBLE",item.label],