Repository navigation
Description
Summary
The widget POSTs an embed report on every page load (#153). That cadence stays. This ticket no
longer measures it or changes it: it records the decision where the next reader will look, and
corrects two places that still describe the server's collapse window as 1 h when the code
collapses at 6 h.
Decisions
- Does reporting on every page load stay? → Yes. The route is unmetered, a repeat costs no
extra read, and writes collapse within 6 h. Revisit only if Railway CPU spent on
POST /api/clients/reportbecomes noticeable. (Ardnived, 2026-10-28)
Approach
Three doc edits and a changelog entry. No product code changes, so nothing here touches
src/lib/embed-announce.ts.
⚠ Edit docs/rules/data-layer.md, never .claude/rules/data-layer.md. The second is a
symlink to the first, and a write at a path under .claude/ is a protected path: the prompt
never fails, the run just waits until its lease expires having written nothing.
1. Record the decision beside the reportEmbed entry (docs/rules/data-layer.md:291),
with the three reasons it is cheap, each checkable at a line:
- The route is unmetered.
clientsis excluded from the usage plugin, so no
beforeOperationhook fires on it and nothing increments a usage counter
(SahajCloud/src/collections/Clients/endpoints/report.ts:26). - A repeat costs no extra read.
req.useris the full client doc, so the handler reads
embedMetadataoff it and answersupdated: falsewith no query and no write
(report.ts:118,report.ts:154). - Writes collapse within 6 h, per
EMBED_REPORT_REFRESH_MS
(SahajCloud/src/lib/clients/embedMetadata.ts:84).
Name the revisit trigger in the same paragraph: Railway CPU spent on /clients/report.
2. Correct docs/embedding.md:314 — "at most one write an hour" → 6 h. This is the
host-facing number, so keep the sentence's register: a host is being told how often a repeat
report turns into a write, not what a constant is called.
3. Correct docs/rules/data-layer.md:295 — "a write the server already collapses by the
hour" → the 6 h window.
⚠ Do not name EMBED_REPORT_MIN_WRITE_INTERVAL_MS. It no longer exists, having been
renamed EMBED_REPORT_REFRESH_MS. It is SahajCloud's constant, so name it as SahajCloud's
wherever a reader could take it for ours.
4. One ### Changed entry in CHANGELOG.md's [Unreleased], with its [#NNN] link
definition at the foot of the file. The changelog leaves documentation out by its own rule
(CHANGELOG.md:9), and this is not an exception to it: the published number was wrong, so a
host that read "one write an hour" and built on it was misinformed. Record the window, not the
edit.
Acceptance criteria
-
docs/rules/data-layer.md'sreportEmbedentry states that reporting on every load
stays, gives the three reasons above with their file references, and names the revisit
trigger. -
docs/embedding.mdsays 6 h, and no file in this repo describes the server collapsing
an unchanged report hourly. - The 6 h figure is written out only where it is the point:
docs/embedding.md, the two
host-facingCHANGELOG.mdentries, and the cadence decision indocs/rules/data-layer.md.
Every other site names SahajCloud'sEMBED_REPORT_REFRESH_MSwith no number.
(review, review-pr, 2026-10-28) - No file in this repo names
EMBED_REPORT_MIN_WRITE_INTERVAL_MS. -
CHANGELOG.md's[Unreleased]carries one### Changedentry for the 6 h window, with
a matching[#NNN]link definition. It says the window bounds writes on our side, not
requests from the host's page. (review, review-pr, 2026-10-28) - No product code changes. A comment-only edit to a source file is in scope where that file
carried the stale figure, proved bycomment-fingerprint.mjsreporting codeHash identical.
The cadence,IDLE_DEADLINE_MSand the module-scopereportedflag are untouched, so
src/lib/embed-announce.test.tsneeds no new case. (review, review-pr, 2026-10-28)
Verification checklist
-
rg -ni hour docs/ CHANGELOG.md src/config/api/mutate.ts src/lib/embed-announce.ts— no
hit describes the report collapse window as hourly. The narrower
an hour|hourly|by the houris what let "within the hour" survive inmutate.ts. -
rg -n 'EMBED_REPORT_MIN_WRITE_INTERVAL_MS' --glob '!node_modules'— no hit. -
rg -n '6 h' docs/embedding.md docs/rules/data-layer.md— at least one hit in each. -
node <claude-workflow>/workflow/lib/comment-fingerprint.mjs --base origin/mainreports
src/config/api/mutate.tsandsrc/lib/embed-announce.tscodeHash identical, so the only
non-doc change issrc/lib/embed-announce.test.ts's fixture. -
.claude/skills/pr-prep/check.shpasses.
Notes
- What the re-scope dropped. The per-day request measurement, the four costed options (do
nothing, sample, cheapen the server path, report on visibility) and the
src/lib/embed-announce.test.tscriterion all went with it. The cadence question is
answered, not deferred. - Detached from Understand how people use the atlas #260. That goal's "Not included" already excludes changing how often an
embed reports itself, and this ticket is not one of its sub-issues. - feat(widget): send the embed report and publish a readiness marker #153 / feat(widget): send the embed report and publish a readiness marker #159 — the change that introduced the cadence, and why the previous gate was removed.
- fix(i18n): production hygiene for logging, locales, and storage #95 — why the widget writes nothing to the host's origin. Still the reason a client-side
"reported recently" key is not on the table. - feat(access): add embed metadata and canonical ownership to Clients SahajCloud#633 — the endpoint. fix(access): evict embed mounts instead of refusing past the cap SahajCloud#639 — the 50-mount cap, which evicts
rather than refuses because this same traffic fills it.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Hold Until
Projects
- StatusShow more project fieldsDone
Activity
Ardnived commentedon Oct 28, 2026
@sydevs-bot revise Re-scope to docs. Record in
.claude/rules/data-layer.md, besidereportEmbed, that reporting on every load stays: the route is unmetered, adds no extra read, and writes collapse within 6 h (EMBED_REPORT_REFRESH_MS). Correctdocs/embedding.md:314anddata-layer.md:294from 1 h to 6 h, with a CHANGELOG line. Revisit only if Railway CPU spent on/clients/reportbecomes noticeable. Detached from #260, which excludes it.sydevs-bot commentedon Oct 28, 2026
🤖 no session running
approved by Ardnived
recent dispatches
Written by the sydevs dispatcher. Sessions never edit this comment.
[-]perf(widget): revisit the report-on-every-load cadence[/-][+]docs(embedding): keep reporting every load, correct the 1 h collapse[/+]sydevs-bot commentedon Oct 28, 2026
Re-scoped to docs. The body now specifies two corrections, the decision record and a changelog
line, and nothing else. Your three reasons are recorded under
## Decisions, each pinned to aline in SahajCloud.
Three things the code changed under the old body:
EMBED_REPORT_MIN_WRITE_INTERVAL_MSno longer exists. It isEMBED_REPORT_REFRESH_MS, sothe docs must not name the old one.
docs/rules/data-layer.md..claude/rules/data-layer.mdis a symlink toit, and a write at that path stalls an unattended run on the protected-path guard.
number was wrong, not merely undocumented.
Changed the type from Task to Bug — a host-facing guide states a number the code
contradicts. Priority stays Low. Cleared the
Hold Untilof 2026-12-18, since the cadencequestion it parked is now answered; say so if you want it held anyway.
@sydevs-bot implementstarts the work.🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Ardnived commentedon Oct 28, 2026
@sydevs-bot implement