Repository navigation
feat: add product-backed resume briefs (#379) - #379
Conversation
Problem: fresh agents need a durable way to reconstruct work state from an archived session after interruption or handoff. A plain transcript dump loses typed facts, product-derived inferences, related sessions, and uncertainty about missing session products. What changed: add a typed ResumeBrief product assembly over conversations, session products, work events, phases, and work threads; expose it through ArchiveOperations, the facade, and a new polylogue resume command with plain and JSON output. Refresh generated help/proof surfaces and add focused core, CLI, help, showcase, and snapshot coverage. Verification: devtools verify -> all checks passed. Focused checks also run: pytest -q tests/unit/core/test_resume.py tests/unit/cli/test_resume.py; pytest -q tests/unit/core/test_resume.py tests/unit/cli/test_resume.py tests/unit/cli/test_click_app.py tests/unit/cli/test_terminal_snapshots.py; devtools verify-showcase; devtools render-all --check; ruff check on touched files; mypy on touched resume/operations files. Closes #309
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughThe PR introduces a new Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as resume_command
participant Ops as ArchiveOperations
participant Domain as build_resume_brief
participant DB as Archive/Products
participant Render as render_resume_brief
User->>CLI: polylogue resume SESSION_ID [--related-limit]
CLI->>Ops: operations.build_resume_brief(session_id)
Ops->>Domain: build_resume_brief(operations, session_id)
Domain->>DB: Load target conversation & facts
alt Conversation found
Domain->>DB: Load session products (profile, enrichment, work-events, phases)
Domain->>DB: Load related sessions from thread/continuation
Domain->>DB: Load work-thread via FTS5/fallback
Domain->>Domain: Compose ResumeFacts, ResumeInferences
Domain->>Domain: Compose next_steps from blockers/intent/outcomes
Domain-->>Ops: ResumeBrief
else Conversation not found
Domain-->>Ops: None
end
CLI->>CLI: Check --json / --format flags
alt JSON requested
CLI->>User: emit_success(brief.model_dump(mode="json"))
else Plain output
CLI->>Render: render_resume_brief(brief)
Render->>User: click.echo formatted sections
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 246f01d15a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
## Summary Adds `polylogue resume <session-id>` as a typed, product-backed handoff surface for reconstructing agent work state from an archived session. The brief combines archive facts, session-product inferences, work events, phase summaries, work-thread context, related sessions, uncertainties, and next-step hints. ## Problem Issue #309 needs a restart/resume path that is more useful than a transcript dump. Fresh agents need stable facts and explicit inference provenance from the archive/product layers, plus clear degradation when session products have not been materialized. ## Solution - Added `polylogue/archive_resume.py` with `ResumeBrief` models and `build_resume_brief()` assembly over conversations, session profiles, enrichments, work events, phases, and work threads. - Exposed resume briefs through `ArchiveOperations`, `Polylogue.resume_brief()`, and the new `polylogue resume` CLI command. - Added plain rendering plus JSON output via `--json`, command-local `--format json`, and root `--format json`. - Included exact work-thread matching through normalized FTS plus unbounded exact fallback over stored `session_ids`, avoiding unsafe raw FTS queries and arbitrary result windows. - Refreshed CLI reference, proof catalog, quality workflow projections, showcase baselines, and terminal snapshots. ## Verification - `devtools verify` -> all checks passed - `pytest -q tests/unit/core/test_resume.py tests/unit/cli/test_resume.py` - `pytest -q tests/unit/core/test_resume.py tests/unit/cli/test_resume.py tests/unit/cli/test_click_app.py tests/unit/cli/test_terminal_snapshots.py` - `devtools verify-showcase` - `devtools render-all --check` - `ruff check polylogue/archive_resume.py polylogue/cli/commands/resume.py polylogue/cli/resume_rendering.py polylogue/cli/click_command_registration.py polylogue/facade_archive.py polylogue/operations/archive.py tests/unit/core/test_resume.py tests/unit/cli/test_resume.py tests/unit/cli/test_click_app.py` - `mypy polylogue/archive_resume.py polylogue/operations/archive.py` - push hook: `devtools verify --quick` -> all checks passed Closes #309
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds
polylogue resume <session-id>as a typed, product-backed handoff surface for reconstructing agent work state from an archived session. The brief combines archive facts, session-product inferences, work events, phase summaries, work-thread context, related sessions, uncertainties, and next-step hints.Problem
Issue #309 needs a restart/resume path that is more useful than a transcript dump. Fresh agents need stable facts and explicit inference provenance from the archive/product layers, plus clear degradation when session products have not been materialized.
Solution
polylogue/archive_resume.pywithResumeBriefmodels andbuild_resume_brief()assembly over conversations, session profiles, enrichments, work events, phases, and work threads.ArchiveOperations,Polylogue.resume_brief(), and the newpolylogue resumeCLI command.--json, command-local--format json, and root--format json.session_ids, avoiding unsafe raw FTS queries and arbitrary result windows.Verification
devtools verify-> all checks passedpytest -q tests/unit/core/test_resume.py tests/unit/cli/test_resume.pypytest -q tests/unit/core/test_resume.py tests/unit/cli/test_resume.py tests/unit/cli/test_click_app.py tests/unit/cli/test_terminal_snapshots.pydevtools verify-showcasedevtools render-all --checkruff check polylogue/archive_resume.py polylogue/cli/commands/resume.py polylogue/cli/resume_rendering.py polylogue/cli/click_command_registration.py polylogue/facade_archive.py polylogue/operations/archive.py tests/unit/core/test_resume.py tests/unit/cli/test_resume.py tests/unit/cli/test_click_app.pymypy polylogue/archive_resume.py polylogue/operations/archive.pydevtools verify --quick-> all checks passedCloses #309
Summary by CodeRabbit
New Features
resumecommand to reconstruct work-state context for starting fresh agent sessions, displaying conversation facts, inferred state, related sessions, and recommended next steps. Supports JSON output format.Documentation
resumecommand.