Skip to content

fix(docs): payload prose contract is snake_case, all six fields (repairs #15) - #17

Open
serenakeyitan wants to merge 1 commit into
mainfrom
docs/prose-contract-snake-case
Open

fix(docs): payload prose contract is snake_case, all six fields (repairs #15)#17
serenakeyitan wants to merge 1 commit into
mainfrom
docs/prose-contract-snake-case

Conversation

@serenakeyitan

Copy link
Copy Markdown
Contributor

Summary

#15 (merged) documented the payload prose as a camelCase rename (verdictHandle / quip) with a ≤500 quip cap. The website side that actually merged (first-tree-website#183) reads the snake_case names verbatim and validates six fields — so a scanner following the current table POSTs dead camelCase keys: they're stored but never validated or rendered, and every hosted report falls back to neutral copy instead of the scan's own roast.

This PR corrects the Step 7 item 4 payload table and the Step 9.5 hosted-report bullet to the real merged contract:

  • Pass through verbatim, snake_case: report_lang, verdict, verdict_handle, verdict_quip (from scan-report.json) + roast_tldr, hero_prose (lifted from the md)
  • Validator-enforced when present: non-blank; caps report_lang ≤10, verdict ≤40, verdict_handle ≤120, verdict_quip ≤240, roast_tldr/hero_prose ≤1000; no control/bidi-override characters (\n allowed)
  • report_lang starting zh switches the hosted page chrome to Chinese; missing fields → neutral copy (tdoc roast reserved for the sample ids)

Contract pair: validateReport in first-tree-website src/pages/api/reports/index.ts (as merged in #183; hardening follow-up first-tree-website#188).

🤖 Generated with Claude Code

… the merged validator

The row merged in #15 documented a camelCase rename (verdictHandle/quip)
that the website never implemented: the merged validator + renderer
(first-tree-website #183) read the snake_case names verbatim —
report_lang, verdict, verdict_handle, verdict_quip, roast_tldr,
hero_prose. A payload built per the old row stores dead camelCase keys
and the hosted page shows neutral copy instead of the scan's own roast.

Corrects the payload table + the hosted-report bullet to the real merged
contract: snake_case verbatim, caps 10/40/120/240/1000/1000, non-blank,
no control/bidi-override chars (\n allowed), report_lang zh… switches
page chrome.

Contract pair: first-tree-website src/pages/api/reports/index.ts
(validateReport).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants