Reconcile docs with reality; fix module graph, token compare, health #1

Open
kami wants to merge 216 commits from webui-and-audit-reconciliation into master
2 changed files with 33 additions and 0 deletions
Showing only changes of commit d7e75e9e31 - Show all commits
+6
View File
@@ -459,6 +459,12 @@ func renderPlanProgress(in Input) string {
fmt.Fprintf(&b, "- %s (%s): verified at %s, stale because the tree is now at %s\n", phase.ID, collapse(phase.Name), short(rec.AtSHA), short(in.Git.HeadSHA))
case rec.Status == domain.PlanPhaseVerified:
fmt.Fprintf(&b, "- %s (%s): verified at %s\n", phase.ID, collapse(phase.Name), short(rec.AtSHA))
case rec.Status == domain.PlanPhaseAwaitingManual && rec.Stale(in.Git.HeadSHA):
// A pending manual gate goes stale for the same reason a verified
// phase does. Run 10 rendered "automated checks passed at
// 94bd45c3b5d6" against a tree that had moved to 7d04aef, because
// only the verified branch consulted Stale.
fmt.Fprintf(&b, "- %s (%s): automated checks passed at %s, stale because the tree is now at %s, waiting for the human to confirm the manual steps\n", phase.ID, collapse(phase.Name), short(rec.AtSHA), short(in.Git.HeadSHA))
case rec.Status == domain.PlanPhaseAwaitingManual:
fmt.Fprintf(&b, "- %s (%s): automated checks passed at %s, waiting for the human to confirm the manual steps\n", phase.ID, collapse(phase.Name), short(rec.AtSHA))
default:
+27
View File
@@ -707,3 +707,30 @@ func TestResearchBriefStatesTheFindingIDRule(t *testing.T) {
}
}
}
// A pending manual gate goes stale for the same reason a verified phase does.
// Run 10 rendered "automated checks passed at 94bd45c3b5d6" against a tree
// that had moved, because only the verified branch consulted Stale.
func TestPendingManualGateRendersStale(t *testing.T) {
plan := &workphase.PlanDoc{Phases: []workphase.PlanPhase{{ID: "phase-1", Name: "one"}}}
task := domain.Task{
ID: "t1", PlanRef: "ref-a",
PlanProgress: &domain.PlanProgress{PlanRef: "ref-a", Phases: []domain.PlanPhaseRecord{
{PlanRef: "ref-a", PhaseID: "phase-1", Status: domain.PlanPhaseAwaitingManual, AtSHA: strings.Repeat("a", 40)},
}},
}
got := renderPlanProgress(Input{
Task: task, Phase: domain.WorkPhaseImplement, Plan: plan,
Git: GitState{HeadSHA: strings.Repeat("b", 40)},
})
if !strings.Contains(got, "stale because the tree is now at") {
t.Errorf("a pending manual gate at a moved sha did not render stale:\n%s", got)
}
fresh := renderPlanProgress(Input{
Task: task, Phase: domain.WorkPhaseImplement, Plan: plan,
Git: GitState{HeadSHA: strings.Repeat("a", 40)},
})
if strings.Contains(fresh, "stale") {
t.Errorf("a pending manual gate at HEAD rendered stale:\n%s", fresh)
}
}