issue-303: Deterministic no-code-change comment-body builder (buildNoCodeChangeCommentBody) #313
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-303/deterministic-no-code-change-comment-body-builder"
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?
303: Deterministic no-code-change comment-body builder (buildNoCodeChangeCommentBody)
Closes #303 — 303.
Generated in 9m 01s.
Review findings
Let me check the artifacts barrel exports and the surrounding conventions to understand what's exported and whether there is an established pattern for deriving the type list in tests.The grep pattern got mangled by the shell. Let me rerun with proper quoting and search the validate file plus tests for related conventions.The tool appears to pass the pattern through a shell. Let me use simpler patterns without
|.Let me look at the existing validator test (same duplication pattern), the implementation plan, and package.json scripts.Let me check ADR-021 for the exact verbatim wording and look at codebase conventions for exporting valid-value arrays.Now let me check the git state and tsconfig to understand the working tree and typecheck settings before editing.The working tree is clean at the Stage-1 commit. Let me check prettier/eslint configs quickly, then apply the fixes.Configs are clear. Now I'll apply all fixes in a single pass:Fix 1 — reword the docstring so the provider-agnostic claim scopes to the fixed frame:Fix 3a — export the canonical
VALID_TYPESarray and re-export it via the artifacts barrel:Adjacent consistency cleanup — the validator's own test duplicates the same list; drive it from the now-exportedVALID_TYPEStoo (removing the unusedNoCodeChangeTypeimport):Let me verify the edits look right, then run the gates.Edits are in place. Now run the gates — lint first:Lint passes. Now build:Build passes. Now the affected test suites, then the full suite:Full suite green (145 files / 2088 tests). Now Prettier check on the changed files and a diagnostic typecheck to ensure no new errors touch the changed files:Prettier is clean. Let me verify none of the typecheck errors reference the changed files:All gates pass. Let me do a final review of the remediation diff:All fixes applied and gates verified. Final message below.Review Findings — 303
Summary
All three Low findings were resolved in a single pass: the docstring now scopes the provider-agnostic claim to the fixed frame (noting
reason/workPerformedare embedded verbatim and not sanitized), the token test was renamed to reflect what it actually guarantees and carries a scope comment, and the duplicated four-type enumeration was eliminated by exporting the canonicalVALID_TYPESarray through the artifacts barrel and iterating it in the test (with a cross-reference comment on the per-type sample list; the validator's own test now iteratesVALID_TYPEStoo, closing the same silent-drift gap there). No findings remain unresolved.Gates re-run after remediation:
npm run lint✅,npm run build✅,npm test✅ (145 files / 2088 tests), Prettier check on the five changed files ✅. Diagnosticnpx tsc --noEmitremains red with 99 pre-existing errors — identical count to the pre-change baseline documented by the review, zero touching the changed files.Critical
High
Medium
Low
src/writeback/helpers/buildNoCodeChangeCommentBody.ts:12-13— The docstring states the body "is provider-agnostic: it contains no MR/PR noun and no platform URL, so the same text works for Jira, GitHub, Forgejo, and GitLab." Becausereason/workPerformedare embedded verbatim (per ADR-021 §3 and the byte-for-byte test at line 87), arbitrary agent-authored field text may legitimately contain "MR", "merge", "pull request", or a URL — the guarantee holds only for the fixed frame, not the full output. Suggested fix: reword to "the fixed frame is provider-agnostic (no MR/PR noun, no platform URL);reason/workPerformedare embedded verbatim per ADR-021 §3" so future readers do not infer sanitization, which would contradict the verbatim requirement.src/writeback/helpers/buildNoCodeChangeCommentBody.test.ts:116— The test name "contains no MR/PR noun and no URL for any artifact type" overstates an invariant the function cannot provide: it only asserts the fixed sample values (reason: 'Handled outside the repository',workPerformed: 'Done via external tooling') produce no tokens, not that any possible artifact does. Suggested fix: rename to e.g. "renders a fixed frame with no MR/PR noun or URL for any artifact type" and add a comment noting the assertion applies to the frame plus the fixed sample values (verbatim fields are outside this guarantee).src/writeback/helpers/buildNoCodeChangeCommentBody.test.ts:117(and the case list at lines 22-45) — The four-type enumeration ('database', 'config', 'docs', 'other') duplicatesVALID_TYPESinsrc/artifacts/helpers/validateNoCodeChange.ts:4-8; if a fifthNoCodeChangeTypeis ever added, the "for any artifact type" coverage silently omits it (the loops stay compile-valid as a subset of the union). Suggested fix: derive the type list from the exportedNoCodeChangeTypeunion or add a cross-reference comment that the list must stay in sync withVALID_TYPES, so a schema extension updates the test surface.