Repository navigation
gh: parse_bounty_comment reads the four comment kinds back (Python + JS, shared vectors) - #53
xiaobaiqiao wants to merge 1 commit into
Conversation
|
Thanks for the genuine cross-runtime PR on #17, @xiaobaiqiao! Clean parser structure and great start on positive + adversarial vectors. We reviewed the diff against #17's acceptance criteria and CI gates — 5 quick fixes will make this merge-ready:
Also, we checked \�alun.tech\ and \xiaobaiqiao\ isn't enrolled yet — whenever you're ready, you can generate your local \secp256k1\ signing key in 30 seconds at https://valun.tech/claim (or via \uvx --from valun==0.9.5 valun join --sandbox --handle xiaobaiqiao) so we can issue your 5 Credits bounty payout as soon as this merges! |
…JS, shared vectors) Closes fitzss#17. parse_bounty_comment / parseBountyComment read the four comments this module renders - bounty bill, award receipt, claim payout, PR gate - back as plain text, and answer with the same keys in both languages: ok, code, kind, bill_id, deal_id, counter_id, repo, issue. The ids keep their vb_/vd_/vctr_ prefix. Refusals are clean, never silent: non-string -> not_text, over COMMENT_MAX -> too_long (never truncated), no Valun heading -> not_valun_comment, an id that is not 16 lowercase hex (or carries a trailing word) -> malformed, two different bill ids -> ambiguous. A commerce comment legitimately names the deal that funds it and the deal that pays, so the first deal or counter id is reported; two different bill ids stay a conflict. Coverage: - spec/vectors/bounty-comments.json: 15 positive and adversarial cases, the shared contract - spec/vectors/check_bounty_comments.py (+ bounty_comments_runner.mjs): both clients over the vectors, and it is wired into spec/vectors/check_parity.py, so 'python spec/vectors/check_parity.py' runs it with everything else - python/tests/test_gh_parse_bounty_comment.py: stdlib unittest, the same vectors plus round-trip against what the four renderers actually wrote (spec/vectors/wave33.json bounty/award/gate markdown, spec/vectors/gh-payout.json payout markdown) - js/test/gh-parse-bounty-comment.test.js: node --test, the same vectors Verified on main a658139 (0.9.16): check_parity 267 cases + 15 bounty-comment cases, 0 disagreements; unittest 6 tests OK; node --test 17 pass, 0 fail.
b3f138d to
2fe349f
Compare
|
All five review points are in, rebased onto
Also: |
Closes #17.
parse_bounty_comment(Python) andparseBountyComment(JavaScript) read the four comments this module renders - bounty bill, award receipt, claim payout, PR gate - back as plain text, and answer with the same keys in both languages:ok,code,kind,bill_id,deal_id,counter_id,repo,issue.Refusals are clean, never silent:
not_textCOMMENT_MAX(65,536) ->too_long(never truncated)not_valun_commentmalformedambiguousmalformedWhere it lives:
python/src/valun/gh.py-parse_bounty_comment, plus the two small helpers it reads withjs/src/gh.js-parseBountyComment(and the same name in snake case), exported fromjs/src/index.js; typed injs/src/index.d.tsspec/vectors/bounty-comments.json- 14 positive and adversarial cases, the shared contractspec/vectors/check_bounty_comments.py(+bounty_comments_runner.mjs) - runs both clients over the vectors and fails on any disagreementpython/tests/test_gh_parse_bounty_comment.pyandjs/test/gh-parse-bounty-comment.test.js- read the same vectorsVerification run here:
The parsers are pure: no network, no globals written, a non-string or an over-long body refused rather than truncated, and a fresh object returned each call.
Valun-Claim: xiaobaiqiao