Skip to content

feat: CLI context-pack, SubjectRef.kind tightening, schema bootstrap fix (#838, #421) - #968

Merged
Sinity merged 4 commits into
masterfrom
feature/feat/remaining-closures
May 8, 2026
Merged

Sinity merged 4 commits into
masterfrom
feature/feat/remaining-closures

Conversation

@Sinity

@Sinity Sinity commented May 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds CLI context-pack command, tightens proof model types, and fixes schema bootstrap literal.

Changes

Verification

devtools verify --quick  # all checks passed

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added context-pack CLI command to export conversation context with filtering options (project path, repository, date range, provider, and result limits).
  • Documentation

    • Updated and reformatted CLI reference documentation and generated catalog snapshots.
  • Chores

    • Database schema upgraded to version 12.

Sinity and others added 4 commits May 8, 2026 12:03
- #838: Add 'polylogue context-pack' CLI command reusing the shared
  context_pack helpers from polylogue.mcp.context_pack. Produces
  ContextPackPayload JSON. Wired as a root CLI command.
- #421: Tighten SubjectRef.kind from str to SubjectKind Literal union
  enumerating all 19 known subject kind values. New kinds must be added
  to the union before use.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Copilot AI review requested due to automatic review settings May 8, 2026 10:16
@Sinity
Sinity merged commit 9ddc1b6 into master May 8, 2026
@Sinity
Sinity deleted the feature/feat/remaining-closures branch May 8, 2026 10:16
@coderabbitai

coderabbitai Bot commented May 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c4395a7f-b443-4048-8f17-d749ff80d12c

📥 Commits

Reviewing files that changed from the base of the PR and between 304ae42 and 4cb6910.

📒 Files selected for processing (11)
  • docs/cli-reference.md
  • docs/plans/topology-target.yaml
  • docs/test-quality-workflows.md
  • docs/topology-status.md
  • docs/verification-catalog.md
  • polylogue/cli/click_command_registration.py
  • polylogue/cli/commands/context_pack.py
  • polylogue/proof/models.py
  • polylogue/proof/subjects.py
  • polylogue/storage/sqlite/schema.py
  • polylogue/storage/sqlite/schema_bootstrap.py

📝 Walkthrough

Walkthrough

This PR introduces a new context-pack CLI command that assembles conversation metadata and action events into a structured provenance-rich payload. It includes proof obligation type refinement, schema version upgrade routing for v11→v12 migrations, and corresponding documentation snapshot updates.

Changes

Context Pack Feature

Layer / File(s) Summary
Proof Subject Typing
polylogue/proof/models.py
Adds SubjectKind as a Literal union of allowed subject kind strings and refines SubjectRef.kind from str to SubjectKind for type safety.
Schema Bootstrap Contracts
polylogue/storage/sqlite/schema_bootstrap.py
Extends SchemaBootstrapDecision.action to include "upgrade_v11_to_v12" as a recognized bootstrap action.
Context Pack Command Implementation
polylogue/cli/commands/context_pack.py
Implements the context-pack CLI command, which filters conversations via MCPConversationQueryRequest, fetches action events in batch with fallback, derives date ranges from timestamps, paginates per-conversation messages with per-conversation error fallback, and outputs a ContextPackPayload as JSON to stdout.
Proof Subjects Type Compatibility
polylogue/proof/subjects.py
Adds # type: ignore[arg-type] comment in architecture_control_subjects() to acknowledge that dynamically-derived subject kinds may not satisfy static type constraints at construction time.
CLI Command Registration
polylogue/cli/click_command_registration.py
Imports context_pack_command and adds it to ROOT_COMMANDS tuple for root Click group registration.
Schema Version Upgrade Paths
polylogue/storage/sqlite/schema.py, polylogue/storage/sqlite/schema_bootstrap.py
Wires v9→v10, v10→v11, and v11→v12 upgrades through version-upgrade plan execution flow in both sync and async functions; adds v11→v12 decision branch and updates module exports.
Documentation & Artifacts
docs/cli-reference.md, docs/plans/topology-target.yaml, docs/test-quality-workflows.md, docs/topology-status.md, docs/verification-catalog.md
Auto-generated documentation snapshots updated: CLI reference reformatted, topology metadata adjusted with new context_pack.py entry and line counts, test workflows include new exercise, verification catalog adds command subject and proof obligation entries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Sinity/polylogue#854: Modifies SQLite schema bootstrap/upgrade logic to add new upgrade paths and wire them through upgrade-plan execution, similar to the schema v11→v12 routing in this PR.
  • Sinity/polylogue#577: Modifies CLI registration, proof/model surfaces, and coverage manifest entries, overlapping with the context-pack command registration and proof type changes in this PR.

Poem

🐰 A new command hops into the CLI,
Packing contexts with data so spry—
Proof types now precise, schema paths aligned,
From v11 to v12, all upgrades defined!
thump-thump 🥕

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/remaining-closures

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.

@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: 4cb6910f89

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

Comment thread polylogue/cli/commands/context_pack.py Resolved
Comment thread polylogue/cli/commands/context_pack.py Resolved
@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.

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

@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.

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