feat: truncate --fields body uniformly (task 0021) #21
Reference in New Issue
Block a user
Delete Branch "task-0021-body-field-truncation-ruling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task:
.claude/tasks/0021-body-field-truncation-ruling.mdSummary
A single ruling on whether
--fields bodytruncates, applied uniformly everywhere thebodyextra field is offered.The ruling: it truncates.
Principle 3 already said body text truncates at 500 chars "in all contexts (list and detail alike)"; the four
--fields bodyextractors were the drift, not the intent."Raw" in the Command Surface is resolved to mean uncleaned markdown (short bodies still pass through byte-for-byte), never unbounded — an unbounded body on a list path lets
issue list --limit 30 --fields bodyspill thirty full bodies into an agent's context, the exact cost Principle 3 exists to prevent.What changed:
truncatedBody()FieldDefinfields.tsroutesbodythrough the sametruncateBody(value, BODY_TRUNCATE_LIMIT, host)the detail views use, so the hint text andcleanBody-on-overflow are byte-identical toissue view/pr view.ExtractContextgained requiredhostandfullfields; everyextractRowcall site updated (body-less ones passfull: false).ISSUE_LIST,ISSUE_CREATE,PR_LIST, andSEARCHextra-field registries now usetruncatedBody("body").--fullflag (suppresses--fields bodytruncation, matchingissue view) was added toissue list,issue create,pr list, andsearch, so the inline hint's "use --full to see complete body" is keepable on every command that offers the field.bodyentries), ADR 0003, and the four commands'--helptext reconciled.Deviations from the plan:
The ACs named only
issue listandissue create, but the task body mandated "any later command exposingbodyvia--fieldsmust behave the same", sopr listandsearchwere included too, each with a parity test.No new e2e case — the task scoped verification to the fixture/unit tier (deterministic string processing, no live-Gitea semantics to attest to).
Verified: full suite green (387 tests), including truncated-and-
--fullfixture tests on all four commands.Review
Overall: LOW
truncatedBody/ExtractContextchange; callers updated uniformly.--fullflag plus a truncation swap; trivial to revert, no migrations or breaking removals.--fullfixture tests in the diff.{ host, full }through calls; new helper is a small pure function.Standards findings left unaddressed
--fullparse/plumb sites repeat the same"--full"flag +const full = flags["--full"] === true+{ now, host, full }shape. Left as-is: each command already parses its flags independently, so extracting a helper would fight the existing per-command structure. (The one hard finding — a multi-sentence spec/ADR line vs. the one-sentence-per-line rule — was fixed in the diff.)Spec findings left unaddressed
None — all four acceptance criteria met; no wrong implementations found.