Skip to content

fix: address review feedback on #959 — PR #944 reconciliation - #961

Merged
Sinity merged 2 commits into
masterfrom
feature/fix/review-feedback-959
May 8, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/fix/review-feedback-959

Conversation

@Sinity

@Sinity Sinity commented May 8, 2026

Copy link
Copy Markdown
Owner

Summary

Post-merge review feedback follow-up for #959. Hardens defensive code, fills in a missing schema upgrade plan, and tightens test assertions.

Problem

Several review findings surfaced after #959 merged:

  • Bare str() calls on provider_meta.get("source") could crash on non-string values
  • _as_float() in outlook.py could crash on non-numeric values
  • build_v11_to_v12_upgrade_plan was missing — the v12 schema had no in-place upgrade path
  • core_formatter.py had a fallback to archive_root / "polylogue.db" that masked config issues
  • Several test assertions were too loose (accepting multiple valid states when only one was correct)

Solution

  • artifacts.py: Use compiled regex for <file path= scan (also a minor perf improvement)
  • outlook.py: Wrap float() in try/except; fix month reference in _resolve_cycle
  • ingest_worker.py, conversations.py, conversations_writes.py: Safe extraction of provider_meta["source"]
  • core_formatter.py: Remove fallback to archive_root / "polylogue.db"
  • schema_bootstrap.py: Add build_v11_to_v12_upgrade_plan with cost/token columns for both messages and session_profiles
  • profiles.py, documents.py, models.py: Wire cost fields into SessionProfile serialization
  • Tests: Tighten assertions in test_check, test_status, test_daemon_status, test_prepare, test_cost_queries, test_vec

Verification

  • devtools verify --quick (pre-push hook) — all checks passed
  • pytest tests/unit/cli/test_check.py tests/unit/cli/test_status.py tests/unit/daemon/test_daemon_status.py tests/unit/pipeline/test_prepare.py tests/unit/storage/test_cost_queries.py tests/unit/storage/test_vec.py -q — focused test run

🤖 Generated with Claude Code

- Add schema v12 in-place migration (ALTER TABLE for cost/token columns on
  messages and session_profiles)
- Fix outlook cycle-end calculation: use start.month, not now.month
- Make _as_float robust against ValueError/TypeError
- Update SessionProfileDocument TypedDict with cost fields; hydrate
  session profile dict with cost provenance
- source_name extraction: use isinstance check instead of str() at all 3 sites
- Remove unconditional legacy DB fallback in ConversationFormatter
- Restore stricter FTS-index-incomplete assertion in test_check.py
- Preserve connection-cleanup contract in test_vec.py
- Restore attachment idempotency assertions in test_prepare.py
- Tighten daemon-status and session-status assertions
- Add all() empty-guard in test_artifact_graph.py
- Restore test_cost_queries specificity with get_credit_rate check
- Document --no-* flags in NixOS module
- Use compiled regex for <file path= context-dump detection
- Add mutation operation contract assertions in test_specs.py
- Fix PR number reference in SCHEMA_VERSION comment
- Addresses all 21 review comments on #959
Copilot AI review requested due to automatic review settings May 8, 2026 06:22
@coderabbitai

coderabbitai Bot commented May 8, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a127b33c-b863-42be-92df-29acf5122ca4

📥 Commits

Reviewing files that changed from the base of the PR and between bcae726 and ddb1597.

📒 Files selected for processing (14)
  • polylogue/archive/message/artifacts.py
  • polylogue/archive/semantic/outlook.py
  • polylogue/archive/session/documents.py
  • polylogue/archive/session/models.py
  • polylogue/pipeline/services/ingest_worker.py
  • polylogue/rendering/core_formatter.py
  • polylogue/storage/insights/session/profiles.py
  • polylogue/storage/repository/archive/writes/conversations.py
  • polylogue/storage/sqlite/queries/conversations_writes.py
  • polylogue/storage/sqlite/schema_bootstrap.py
  • polylogue/storage/sqlite/schema_ddl.py
  • tests/unit/cli/test_status.py
  • tests/unit/storage/test_cost_queries.py
  • tests/unit/storage/test_vec.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/review-feedback-959

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Three assertions claimed invariants the code doesn't guarantee:
- test_ingest_idempotent: save_bundle idempotency is hash-dependent
- test_check: FTS readiness model treats empty index on seeded archive as ok
- test_daemon_status: freshness_info probed twice (status + deep readiness)

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@Sinity
Sinity merged commit 20d81db into master May 8, 2026
3 checks passed
@Sinity
Sinity deleted the feature/fix/review-feedback-959 branch May 8, 2026 06:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 194b6223b9

ℹ️ 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".

@Sinity
Sinity removed the request for review from Copilot May 8, 2026 06:46
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 76.F071 / P1: refuted at the checked revision: Wiring the predecessor v11-to-v12 upgrade plan back into bootstrap contradicts the current one-shape derived-index lifecycle. The fresh-format contract excludes migration or readback of earlier Polylogue state, while allowing new external source ingestion. See AGENTS.md:75.

Only the rows listed above are dispositioned. Held findings remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant