-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add public anonymous one-page check as the proof-to-repair entry path #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,11 +1,13 @@ | ||||||||||||||||||||||||||||
| import assert from "node:assert/strict"; | ||||||||||||||||||||||||||||
| import test from "node:test"; | ||||||||||||||||||||||||||||
| import { demoHtml, methodologyHtml, packagesHtml } from "../worker/routes/pages.js"; | ||||||||||||||||||||||||||||
| import { checkHtml } from "../worker/routes/public-check.js"; | ||||||||||||||||||||||||||||
| import { publicPageSpotChecks, spotCheckPublicPages } from "./live-promise-spot-check.mjs"; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const origin = "https://seofixkit.com"; | ||||||||||||||||||||||||||||
| const pages = { | ||||||||||||||||||||||||||||
| "/demo": demoHtml(origin), | ||||||||||||||||||||||||||||
| "/check": checkHtml(origin), | ||||||||||||||||||||||||||||
| "/methodology": methodologyHtml(origin), | ||||||||||||||||||||||||||||
| "/packages": packagesHtml(origin) | ||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||
|
|
@@ -27,16 +29,16 @@ function htmlResponse(body, status = 200) { | |||||||||||||||||||||||||||
| return new Response(body, { status, headers: { "content-type": "text/html" } }); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| test("live spot-check covers the three promised public pages", () => { | ||||||||||||||||||||||||||||
| test("live spot-check covers the four promised public pages", () => { | ||||||||||||||||||||||||||||
| assert.deepEqual( | ||||||||||||||||||||||||||||
| publicPageSpotChecks(origin).map((check) => check.path), | ||||||||||||||||||||||||||||
| ["/demo", "/methodology", "/packages"] | ||||||||||||||||||||||||||||
| ["/demo", "/check", "/methodology", "/packages"] | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| test("live spot-check passes against the shipped public page copy", async () => { | ||||||||||||||||||||||||||||
| const results = await spotCheckPublicPages({ baseUrl: origin, fetcher: pageFetcher() }); | ||||||||||||||||||||||||||||
| assert.equal(results.length, 3); | ||||||||||||||||||||||||||||
| assert.equal(results.length, 4); | ||||||||||||||||||||||||||||
|
Comment on lines
39
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Assert that all spot-check expectations pass.
Suggested assertion assert.equal(results.length, 4);
+ assert.deepEqual(
+ results.flatMap(({ path, failures }) =>
+ failures.map((failure) => `${path}: ${failure}`)
+ ),
+ []
+ );📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| for (const result of results) { | ||||||||||||||||||||||||||||
| assert.deepEqual(result.failures, [], `${result.path} must pass: ${result.name}`); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Narrow the storage claim.
The rate-limit design stores hashed network and target identifiers in
audit_usage, andREADME.md, Line 57 documents quota-bucket cleanup. The phrasenothing storedcan mislead users about retention. State that no report or page contents are stored. Apply the same wording topublic/.well-known/skill.md, Line 10, and the/checkcopy inworker/routes/public-check.js, Lines 192-351.🤖 Prompt for AI Agents