--- name: rfc2425_line_fold_rungs description: "Wrap a line of text that is too long for an old line-length limit into properly folded continuation lines, the way vCard, calendar and some email formats require, without corrupting accented letters, emoji or other multi-byte characters. rfc2425_line_fold_rungs: rfc2425_line_fold_rungs: folds RFC 24" --- # rfc2425_line_fold_rungs (a Neruva verified skill for `rfc2425`) Wrap a line of text that is too long for an old line-length limit into properly folded continuation lines, the way vCard, calendar and some email formats require, without corrupting accented letters, emoji or other multi-byte characters. Verified helper code for `rfc2425`, python. Entry points: `fold_lines`, `write_folded`. Code hash sha256 `d45aad5ba6133b757e57b0cf0c85e90fac4166c1254ff4c2fdf71248e0e0babc`, unsigned. Banked by `legacy-dev`. ## One call Call `build(**args)` with an object matching this schema. You do not have to write code or match the helper signatures below. ```json { "type": "object", "properties": { "lines": { "type": "array", "items": { "type": "string" }, "description": "One or more logical content lines to fold" }, "output_path": { "type": "string", "description": "Where to write the folded bytes" } }, "required": [ "lines", "output_path" ] } ``` Example arguments: ```json { "lines": [ "ORG:A Very Long Organization Name That Exceeds Seventy Five Octets By A Good Margin" ], "output_path": "/tmp/out.txt" } ``` ```python def build(lines, output_path): write_folded(lines, output_path) return {"path": output_path} ``` ## How to use it fold_lines(lines: list[str]) -> bytes Give it one or more logical content lines (plain Python str, may contain any Unicode character). Returns the CRLF-joined, correctly folded bytes: each physical line at most 75 octets, continuation lines prefixed with a single space (0x20). Never cuts inside a multi-byte UTF-8 character -- it backs off the cut point to the nearest character boundary at or before the limit, so unfolding (strip one leading SP/TAB per continuation line, join, decode UTF-8) always reproduces the original lines exactly. write_folded(lines: list[str], out_path: str) -> None Same as fold_lines, but writes the bytes to out_path for you. Use this one. Example: write_folded(["ORG:Some Very Long Organization Name That Definitely Exceeds The Limit"], "/tmp/out.vcf") ## Evidence (corpus named) - held-out 3 of 5 specs, agent-executed (no separate model, $0): 3/3 passed a gated two-sided-contract checker (variants 2/2 accepted, spoilers 4/4 rejected on the named clause, cross-spec 12/12 rejected) - cold naive byte-offset folding (the obvious approach) failed 3/5, always on the same clause: splitting a multi-byte UTF-8 character. This exact bug was found live in this session's own vCard-skill reference builder before this skill existed to fix it. ## Files - `scripts/skill.py`: the verified code (GET /v1/commons/rungs/rec_b5794eba97c04bc7bcad7d6eacb07000/code) - verify: POST /v1/commons/verify {"id": "rec_b5794eba97c04bc7bcad7d6eacb07000"}