Plan B: fully remove the degraded/degradedStages concept #293
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
Delete the now-vestigial
degraded/degradedStagesconcept everywhere:the
mr-result.jsonartifact schema, the MR description, the finalrun summary, and the design docs. This is a deliberate artifact-schema
change and per
AGENTS.mdmust updateDESIGN.md,IMPLEMENTATION_PLAN.md,and the corresponding tests together.
Full implementation plan already exists at
docs/plan-B-remove-degraded.md(committed in #292) — this issue tracks executing it.
Background
retiring
*_SKILL_PATH— shipped via issue #28 (closed). Plan A's owndescription explicitly states
degraded/degradedStageswereintentionally retained at that time for schema/downstream
compatibility, always
false/[].degradedonly ever existed to signal "a per-stage skill was missing, soa default body was used." After Plan A there are no external skills, so
it can never actually be
trueagain — it's dead weight.DegradedStage,PriorDegradedStage,degradedStages,priorDegradedStagesall existverbatim in
src/mr/types/mr.ts.across open/closed issues) — this issue closes that gap.
Why this is a separate, larger change than Plan A
Removing
degradedStagestouches the artifact contract (mr-result.json),so it carries schema-compatibility risk and doc churn that Plan A
deliberately avoided by keeping the flag around.
Implementation Details (see
docs/plan-B-remove-degraded.mdfor full detail)DegradedStage,PriorDegradedStage,the
degradedfield on stage result types,degradedStagesonMrResult,and
priorDegradedStageson the MR stage input(
src/mr/types/mr.ts,src/artifacts/helpers/validateMrResult.ts,src/artifacts/services/mrResultArtifact.ts).degradedStagesinput andthe "## Degraded stages" section (
src/mr/helpers/buildMrDescription.ts,src/orchestrator/helpers/buildFinalSummary.ts).ComposeStagePromptResultbecomes{ systemPrompt }only; removedegradedfrom everyRun*StageResult.priorDegradedStagesassembly block and thedegraded ? ... : undefinedmapping insrc/orchestrator/services/runPipeline.ts.file list).
DESIGN.md(§3.4 schema,Stage sections, D15/D16, failure-mode table, config section),
IMPLEMENTATION_PLAN.md, andAGENTS.md's error-handling policy table.Acceptance Criteria
DegradedStage,PriorDegradedStage,degraded,degradedStages,priorDegradedStagesfully removed fromsrc/mr/types/mr.tsand allconsumers.
mr-result.jsonschema no longer includesdegradedStages; validatorupdated to reject it (or ignore it, per the schema-compat decision made
during implementation).
stages.
ComposeStagePromptResultis{ systemPrompt }only.DESIGN.md,IMPLEMENTATION_PLAN.md,AGENTS.mdupdated together withthe code change (per AGENTS.md's schema-compatibility convention).
grep -rn "degrad" srcreturns clean (or only intentional historicalreferences in comments/docs).
npm run lint,npm test,npm run buildall pass.Test Plan
src/artifacts/helpers/validateMrResult.test.ts,src/artifacts/services/mrResultArtifact.test.ts,src/mr/helpers/buildMrDescription.test.ts,src/orchestrator/helpers/buildFinalSummary.test.ts,src/orchestrator/services/runPipeline.test.ts,src/*/services/run*Stage.test.ts,src/stage/helpers/composeStagePrompt.test.tsper the plan doc.PILOOP_E2E=1 npm run e2eto confirmmr-result.jsonis stillvalid without
degradedStages.Compatibility note
Removing
degradedStagesis a breaking change tomr-result.json. Sincerun artifacts are per-run and ephemeral under
.pi-loop/runs/<run-id>/,there is no historical migration to perform, but the schema version/notes in
DESIGN.mdmust record the removal.Related
docs/plan-B-remove-degraded.md(committed in #292)