Problem
Every existing validate-diff spec uses a diff that modifies a function body (a comment update, a code addition). The change-process pipeline detects function names from added lines regardless of whether the body or the signature changed — but no spec verifies signature detection specifically.
A broken pipeline that only fires when the function body changes would pass the entire current validate-diff suite.
Root Cause Detail
parseUnifiedDiff strips the leading + from added lines. goFuncRE and goMethodRE then match the bare declaration. For a parameter-removal diff:
-func DeleteRecord(id string, optFinalizer func(data any) error) error {
+func DeleteRecord(id string) error {
The added line func DeleteRecord(id string) error { is what the pipeline processes. goFuncRE = ^\s*func\s+([A-Z][A-Za-z0-9_]*)\s*\( matches DeleteRecord → LookupByQualifiedNameSuffix("DeleteRecord") → finds the scoped entity → fires flow_unreviewed.
Critical: both goFuncRE and goMethodRE require an uppercase first letter. Private functions (lowercase) are never extracted by the pipeline. A spec targeting a private function as the api-break target produces 0 findings and passes for the wrong reason.
What Is Missing
T3.2 — Signature-change detection
tests/e2e/specs/validate-diff/api-break-parameter-removal-emits-finding.yaml
Uses the go-module-multi-receiver fixture. demo.api-break.diff removes the optFinalizer parameter from server.DeleteRecord (uppercase D — extractable by goFuncRE). DeleteRecord is scoped under DeleteAPIFlow.
Steps:
parameter_removal_emits_flow_unreviewed — asserts flow_unreviewed, server.DeleteRecord, DeleteAPIFlow in output
private_func_change_produces_no_finding — demo.unscoped.diff touches handleRequest (lowercase h, never extracted by pipeline) → asserts "0 findings". Catches a pipeline that incorrectly case-folds names before matching.
Status
Spec implemented and passing on impl/phase2.
References
internal/change_process/pipeline.go lines 1062–1063 — goFuncRE, goMethodRE
internal/change_process/pipeline.go lines 1015–1040 — parseUnifiedDiff (strips leading +)
tests/e2e/specs/validate-diff/api-break-parameter-removal-emits-finding.yaml
Problem
Every existing
validate-diffspec uses a diff that modifies a function body (a comment update, a code addition). The change-process pipeline detects function names from added lines regardless of whether the body or the signature changed — but no spec verifies signature detection specifically.A broken pipeline that only fires when the function body changes would pass the entire current
validate-diffsuite.Root Cause Detail
parseUnifiedDiffstrips the leading+from added lines.goFuncREandgoMethodREthen match the bare declaration. For a parameter-removal diff:The added line
func DeleteRecord(id string) error {is what the pipeline processes.goFuncRE = ^\s*func\s+([A-Z][A-Za-z0-9_]*)\s*\(matchesDeleteRecord→LookupByQualifiedNameSuffix("DeleteRecord")→ finds the scoped entity → firesflow_unreviewed.Critical: both
goFuncREandgoMethodRErequire an uppercase first letter. Private functions (lowercase) are never extracted by the pipeline. A spec targeting a private function as the api-break target produces 0 findings and passes for the wrong reason.What Is Missing
T3.2 — Signature-change detection
tests/e2e/specs/validate-diff/api-break-parameter-removal-emits-finding.yamlUses the
go-module-multi-receiverfixture.demo.api-break.diffremoves theoptFinalizerparameter fromserver.DeleteRecord(uppercase D — extractable bygoFuncRE).DeleteRecordis scoped underDeleteAPIFlow.Steps:
parameter_removal_emits_flow_unreviewed— assertsflow_unreviewed,server.DeleteRecord,DeleteAPIFlowin outputprivate_func_change_produces_no_finding—demo.unscoped.difftoucheshandleRequest(lowercase h, never extracted by pipeline) → asserts"0 findings". Catches a pipeline that incorrectly case-folds names before matching.Status
Spec implemented and passing on
impl/phase2.References
internal/change_process/pipeline.golines 1062–1063 —goFuncRE,goMethodREinternal/change_process/pipeline.golines 1015–1040 —parseUnifiedDiff(strips leading+)tests/e2e/specs/validate-diff/api-break-parameter-removal-emits-finding.yaml