diff --git a/SESSIONLOG.md b/SESSIONLOG.md index ec6f3236c10..57ddcbef415 100644 --- a/SESSIONLOG.md +++ b/SESSIONLOG.md @@ -36,3 +36,4 @@ - Separated explicit explanation-only PR comments from change feedback so they are audited without revision bumps, `fix_needed` transitions, repair evidence, or misleading repair ledger text; repeated-pause rejection feedback now confirms the pause remains effective instead of repeating the submitted syntax. - Corrected paused-feedback ledger wording so actionable feedback remains visibly pending without claiming repair Work was requested while pause prevents allocation. - Changed fast command receipt reactions from `+1` to `eyes` and added an idempotent post-state-commit `+1` only for commands accepted and durably executed by serialized reconciliation. +- Made pause the primary visible status in lifecycle ledgers and the public status page while retaining the underlying activity as pending context; paused ledgers no longer suggest another pause command. diff --git a/upstreaming/README.md b/upstreaming/README.md index 47a4f5b3fd7..e0977e069b7 100644 --- a/upstreaming/README.md +++ b/upstreaming/README.md @@ -235,8 +235,12 @@ compiler and action updates: [`dependencies/README.md`](dependencies/README.md). The `riseproject-dev` App appends a concise 1-2 line ledger comment after every durable lifecycle event. Each entry shows revision, phase/activity, action, outcome and controller workflow link, followed by a folded **Possible next -commands** section with the current revision/head prefilled. Entries are never -edited, so user commands and pipeline history remain interleaved chronologically. +commands** section with the current revision/head prefilled. A paused record is +shown primarily as `phase/paused`; its retained underlying activity is described +as pending until resume, never as current automatic activity. The public status +page likewise shows `Paused` first and includes the retained phase/activity only +as context. Entries are never edited, so user commands and pipeline history +remain interleaved chronologically. A rejected command receives a separate App-authored reply that quotes the exact command, pings its author, explains the rejection and shows a corrected form when one is known. A separate controller job promptly adds an `eyes` reaction when diff --git a/upstreaming/generate_doc.py b/upstreaming/generate_doc.py index 1312cfb9868..99e400fe3e8 100644 --- a/upstreaming/generate_doc.py +++ b/upstreaming/generate_doc.py @@ -34,6 +34,9 @@ def status_label(state: dict) -> str: activity = ACTIVITY_LABELS.get( state["activity"], state["activity"].replace("_", " ") ) + if state.get("paused"): + pending = f"; {activity} pending" if activity else "" + return f"Paused ({phase}{pending})" return f"{phase} ({activity})" if activity else phase diff --git a/upstreaming/status_ledger.py b/upstreaming/status_ledger.py index 62e03f85e85..cf05af00c4e 100644 --- a/upstreaming/status_ledger.py +++ b/upstreaming/status_ledger.py @@ -36,8 +36,9 @@ def _command_lines(record: dict) -> list[str]: lines = [] phase = record["phase"] if phase not in ("released", "abandoned", "superseded", "no_work", "already_released"): - lines += [f'/upstreaming pause revision={revision} reason="..."', - f'/upstreaming park revision={revision} reason="..."', + if not record.get("paused"): + lines.append(f'/upstreaming pause revision={revision} reason="..."') + lines += [f'/upstreaming park revision={revision} reason="..."', f'/upstreaming abandon revision={revision} reason="..."'] if record.get("paused") or record.get("blocked_reason"): lines.append(f'/upstreaming resume revision={revision} reason="..."') @@ -59,11 +60,17 @@ def render(event: dict, record: dict, run_url: str) -> str: revision = event.get("to", {}).get("revision", record["revision"]) phase = event.get("to", {}).get("phase", record["phase"]) activity = event.get("to", {}).get("activity", record["activity"]) + underlying_activity = activity + if record.get("paused"): + activity = "paused" kind = event["kind"] message = MESSAGES.get(kind, kind.replace("_", " ").replace(":", ": ").capitalize() + ".") if kind == "development_review_feedback" and record.get("paused"): message = ("Recorded authorized development-PR change feedback. Repair remains pending, " "but no Work was requested because the contribution is paused.") + elif kind == "command:pause": + pending = underlying_activity.replace("_", " ") + message = f"Paused automatic work. Pending lifecycle activity `{pending}` is retained until resume." visible = f"**Upstreaming r{revision} · {phase}/{activity}** — {message} [Workflow run]({run_url})" commands = _command_lines(record) details = "" diff --git a/upstreaming/tests/test_generate_doc.py b/upstreaming/tests/test_generate_doc.py index 77fb0960fd8..c8415b8cd28 100644 --- a/upstreaming/tests/test_generate_doc.py +++ b/upstreaming/tests/test_generate_doc.py @@ -40,6 +40,14 @@ def test_render_links_and_orders_tracking_rows(self): self.assertIn("Development (waiting for CI)", rendered) self.assertEqual(rendered.count("\n| [example/"), 2) + def test_paused_state_is_primary_status_with_pending_activity_context(self): + self.assertEqual(generate_doc.status_label({"phase": "development", "activity": "fix_needed", + "paused": True}), + "Paused (Development; fix needed pending)") + self.assertEqual(generate_doc.status_label({"phase": "development", "activity": "idle", + "paused": True}), + "Paused (Development)") + if __name__ == "__main__": unittest.main() diff --git a/upstreaming/tests/test_status_ledger.py b/upstreaming/tests/test_status_ledger.py index bd52812f4b2..70afb62d28a 100644 --- a/upstreaming/tests/test_status_ledger.py +++ b/upstreaming/tests/test_status_ledger.py @@ -55,9 +55,21 @@ def test_paused_feedback_ledger_does_not_claim_work_was_requested(self): "review-1", NOW, True) event["sequence"] = 14 body = status_ledger.render(event, record, "https://github.com/run") + self.assertTrue(body.startswith("**Upstreaming r8 · development/paused**")) self.assertIn("Repair remains pending", body) self.assertIn("no Work was requested because the contribution is paused", body) self.assertNotIn("and requested repair", body) + self.assertNotIn("/upstreaming pause revision=8", body) + self.assertIn("/upstreaming resume revision=8", body) + + def test_pause_event_explains_retained_pending_state(self): + record = contribution(phase="development", activity="fix_needed", revision=10, paused=True) + event = lifecycle._event(record, record, "command:pause", "command", "comment-1", NOW, False) + event["sequence"] = 15 + body = status_ledger.render(event, record, "https://github.com/run") + self.assertTrue(body.startswith("**Upstreaming r10 · development/paused**")) + self.assertIn("Paused automatic work", body) + self.assertIn("Pending lifecycle activity `fix needed` is retained until resume", body) def test_unpaused_feedback_ledger_reports_repair_request(self): record = contribution(phase="development", activity="fix_needed", revision=8, paused=False)