Skip to content

feat(indexnow): re-enable submission for the curated set - #320

Draft
harlan-zw wants to merge 7 commits into
mainfrom
feat/indexnow-curated
Draft

harlan-zw wants to merge 7 commits into
mainfrom
feat/indexnow-curated

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Experiment A (Bing as a control) needs IndexNow back. nuxt-ai-ready 2.x dropped its IndexNow support in #53, so nothing submits today. The old submitter sent 424k submissions for 143k pages and drew HTTP 429 for eight days.

This adds a small submitter that cannot flood by design:

flowchart LR
  T[indexnow-submit, hourly at :10] --> K{key file 200?}
  K -->|no| X[log reason, send nothing]
  K -->|yes| G{gate open?}
  G -->|closed| L[log reason, send nothing]
  G -->|open| S[curated sitemaps via SELF]
  S --> P[new or lastmod moved; run cap 200, day cap 1000]
  P --> W[write ledger row and pending strike]
  W --> I[POST api.indexnow.org]
  I -->|200 or 202| R[settle: record fingerprints, clear strikes]
  I -->|429, 5xx, thrown| B[settle: keep strike, store retry time]
  I -->|400 or 422| Q[halve next request, skip a lone bad URL]
  B -->|3 strikes| H[halt 24h or Retry-After, max 7 days]
Loading
  • The URL set is the skills, pages, authors and sources sitemaps. No table scan, no tags.
  • A URL goes out only if it is new or its sitemap lastmod moved. A bulk lastmod bump drains over days because of the caps.
  • 429 stores a retry time (the larger of the schedule and Retry-After). Three failures halt the task for 24 hours. The reason goes to console.error, a wide event and sync_jobs.
  • The ledger row and a pending strike are written before the POST, then settled. A thrown send or a D1 failure after an accepted batch still counts against the caps and adds a strike. Nothing is marked submitted until IndexNow accepts it.
  • A 400 or 422 halves the next request until one URL stands alone. That URL is skipped until its lastmod moves. Other 4xx halt for 24 hours. A 200 character excerpt of the response body reaches the log and halt reason.
  • Retry-After is honoured up to 7 days, on a backoff and on a halt.
  • The key file is answered by a Nitro route (server/handlers/indexnow-key.ts, registered from INDEXNOW_KEY), so the Worker serves it whether or not the assets router runs. The static public/ copy is gone. The task and production smoke both require 200 with the key.
  • Reuses the existing 10 * * * * trigger. Migration 0128 adds three small tables.

Not tried: a live submission to api.indexnow.org. After deploy, read indexnow_batches and the indexnow-submit row in sync_jobs once the first :10 tick has run.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

The old module submitted 143k pages and never recorded what IndexNow accepted. These tables hold the accepted fingerprint per URL, a batch ledger for the daily cap, and the backoff clock.
A URL is a candidate only when new or its sitemap lastmod moved. One run and one day have hard caps, so a bulk lastmod bump drains slowly. A 429 stores a retry time, and three failures halt the task with a reason.
The task reuses the existing :10 trigger. Production smoke now requires the key file to answer 200 with the key, since IndexNow answers 403 without it.
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Sep 30, 2026
@harlan-github-agent

harlan-github-agent Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🟠 Blocked · merge conflict; the review itself passed

No issues found in 13a2d81.

2 notes below 40/100 not shown.

2026-09-30 11:10 UTC · Harlan Agent Kit automated review, not Harlan's; a person merges · AI policy

@harlan-github-agent harlan-github-agent Bot added harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Sep 30, 2026
harlan-zw added a commit that referenced this pull request Sep 30, 2026
Experiment D links harlanzw.com posts to two skilld pages. Both need to
be indexable whatever their quality score, so a probe row waives the
score and nothing else. Renumber the migration to 0129, because the
IndexNow PR (#320) takes 0128.
A thrown send or a D1 failure after an accepted batch now counts against the caps and adds a strike. A 400 or 422 halves the next request. Retry-After is honoured up to seven days. Response bodies reach the halt reason.
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-ready The automated Review passed every gate on this head commit. labels Sep 30, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-blocked The automated Review found a material defect in this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-blocked The automated Review found a material defect in this head commit. labels Sep 30, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Sep 30, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-blocked The automated Review found a material defect in this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Sep 30, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Sep 30, 2026
@harlan-zw
harlan-zw marked this pull request as draft September 30, 2026 14:31
@harlan-github-agent harlan-github-agent Bot added harlan-agent-pending The automated Review is waiting on a gate for this head commit. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-ready The automated Review passed every gate on this head commit. harlan-agent-pending The automated Review is waiting on a gate for this head commit. labels Sep 30, 2026

@harlan-github-agent harlan-github-agent Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Blocked · read the review

Harlan Agent Kit automated review, not Harlan's · AI policy

@harlan-github-agent harlan-github-agent Bot added harlan-agent-blocked The automated Review found a material defect in this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-ready The automated Review passed every gate on this head commit. harlan-agent-blocked The automated Review found a material defect in this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Oct 5, 2026
policy: observedSchedulePolicy('indexnow-submit'),
}, async () => {
const startedAt = Date.now()
const run = await runIndexNow({

@harlan-github-agent harlan-github-agent Bot Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ A thrown run never updates sync_jobs, so /admin/integrity can show a stale ok status for a task that is failing hourly · 25/100 · does not block merge

The effect calls runIndexNow without try/catch; if it throws (selfFetch body read, recordAttempt/settle D1 batch failure) reportJobRun at line ~57 never executes, so sync_jobs keeps its stale last_status while sibling task ai-ready-cron.ts reports status 'error' in a catch before rethrowing. runObservedScheduledTask records the failure only in scheduled_runs.

Harlan Agent Kit automated review, not Harlan's · AI policy

Comment thread server/utils/indexnow.ts
await settleAttempt(deps.db, { id, status, urls: [], state: current }, now)
return { _tag: 'failed', submitted, outcome, state: current }
}
const strikes = current.strikes + 1

@harlan-github-agent harlan-github-agent Bot Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Three consecutive isolated 400/422 URLs halt the whole submission task for 24 hours, a behaviour the described skip design does not mention · 20/100 · does not block merge

In the splittable single-URL branch, strikes = current.strikes + 1 and the third consecutive lone 400/422 calls applyOutcome, which sets notBefore to now + 24h and a haltReason. The PR flowchart describes lone bad URLs as skipped, not halting; three individually bad URLs in a row therefore stop all submissions for 24 hours. Tests only cover one skip (halt_reason null).

Harlan Agent Kit automated review, not Harlan's · AI policy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

harlan-agent-blocked The automated Review found a material defect in this head commit.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant