228: Friction: wire remediate stage — parse friction first, strip-before-findings, artifact write #243
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-228/friction-wire-remediate-stage-parse-friction-first"
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?
228: Friction: wire remediate stage — parse friction first, strip-before-findings, artifact write
Implements 228.
Generated in 17m 33s.
Review findings
Now let me look at the logging implementation and the review stage for context:I have a full picture now. Let me implement the fixes. Starting with the shared
persistFrictionhelper (Medium finding #1):Now export it from the friction barrel:Now updaterunImplementStage.tsto use the shared helper:Now updaterunRemediateStage.tsto use the shared helper and drop the local duplicate:Now updaterunPipeline.tsfor the High and Low findings:Now let me add a unit test for the sharedpersistFrictionhelper:Now add the pipeline wiring and friction-strip regression tests torunPipeline.test.ts:Now let me run the build to check for type errors:Build passes. Now lint:Lint passes. Now run the targeted test files:All targeted tests pass. Now run the full test suite:All 1899 tests pass. Re-run lint and build to confirm everything is still green after the test edits:All gates green. Let me verify the complete diff of my remediation changes:Let me check whether any other tests assert the raw annotatedFindings flows to the MR stage:No conflicting assertions. Let me make one small doc clarification on the remediate result type so the raw-vs-MR-facing distinction is explicit:Final gate run:All gates green: build (tsc) PASS, lint (eslint) PASS, test (vitest) PASS — 1899 tests / 136 files.Remediation summary
I resolved all four findings in a single pass:
runPipelinenow handsstripFrictionSection(remediateResult.annotatedFindings)torunMr, so the## Frictionsection (and its diagnostics like "the build failed because the lockfile was stale") never reaches the Draft MR body. Added a regression test inrunPipeline.test.tsthat builds the description exactly as the MR stage does and asserts no## Frictionsection and no diagnostic text.persistFriction: extracted the shared stamp-and-write helper tosrc/friction/services/persistFriction.ts, exported it via the friction barrel, and switched bothrunImplementStageandrunRemediateStageto call it (the remediate stage's local copy was deleted). Added focused unit tests (persistFriction.test.ts: provenance stamping, empty artifact,unknownmodel,wellFormedpassthrough, non-fatal write failure).runPipelinetest assertingrunRemediatereceivesrunIdand a stage-scoped logger (a warning written through it carries the[HH:mm remediate]prefix), plus the friction-strip regression above.defaultSkippedImplementResult/defaultSkippedRemediateResultnow readfriction.jsonfromrunDirvia areadSkippedFrictionhelper with an empty fallback on read/validation error; the stale NOTE comments were removed.No findings remain unresolved.