Skip to content

chore: clean baseline — drop 3 dead modules, split artifacts/__init__.py (#599, #729) - #752

Merged
Sinity merged 1 commit into
masterfrom
feature/chore/slice-a-clean-baseline
May 3, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/chore/slice-a-clean-baseline

Conversation

@Sinity

@Sinity Sinity commented May 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Drops 3 confirmed-dead production modules and splits the 1072-line polylogue/artifacts/__init__.py into 3 files.

Problem

Solution

#599 — split artifacts/init.py

  • descriptors.py (60 lines), runtime.py (1005 lines), __init__.py (21 lines re-export shim)

#729 — delete dead modules

  • showcase/context.py, cli/insights_rendering.py, cli/shared/qa_finalization.py + dependent tests

Kept: schema_command_support.py (used by devtools), read_fields.py (load-bearing; subsumed by #621)

Verification

  • ruff/mypy/import smoke — clean

Summary by CodeRabbit

  • Documentation

    • Updated verification catalog to reflect current source locations.
  • Refactor

    • Reorganized internal artifact handling structure.
    • Removed unused internal CLI modules for insights rendering and QA finalization.
    • Removed unused showcase context module.
  • Tests

    • Removed tests for deleted internal modules.

Closes #599, partially closes #729.

## Problem

- `polylogue/artifacts/__init__.py` had grown to 1072 lines mixing type definitions
  with a large runtime artifact graph data block (#599).
- Static analysis (#729) identified 5 dead-or-test-only modules. Three are truly
  unused; two were misclassified.

## Solution

### #599 — split artifacts/__init__.py
- `polylogue/artifacts/descriptors.py` (60 lines) — `ArtifactLayer`, `ArtifactNode`, `ArtifactPath`.
- `polylogue/artifacts/runtime.py` (1005 lines) — `RUNTIME_ARTIFACT_NODES`, `RUNTIME_ARTIFACT_PATHS`, builders.
- `polylogue/artifacts/__init__.py` (21 lines) — re-export shim. All existing imports keep working.

### #729 — delete dead modules (3 of 5 candidates)
Deleted, with their tests:
- `polylogue/showcase/context.py` — confirmed dead.
- `polylogue/cli/insights_rendering.py` + `tests/unit/cli/test_insights_helper_runtime.py` — docstring already noted "replaced by generic render_insight_items()".
- `polylogue/cli/shared/qa_finalization.py` + `tests/unit/cli/test_qa_finalization.py` — never wired to a CLI verb.

Kept (with rationale):
- `polylogue/cli/shared/schema_command_support.py` — actually used by `devtools/schema_generate.py:9`. #729 missed this devtools dependency.
- `polylogue/archive/query/read_fields.py` + `tests/unit/core/test_query_read_fields.py` — load-bearing for the API-method-parameter parity check in `test_query_field_catalog_covers_api_query_method_names` (covers `content_projection`). Will be subsumed by the unified `QueryFieldDescriptor` in #621.

### Generated surface drift
Regenerated `docs/verification-catalog.md` via `python3 devtools/render_all.py`.

## Verification

- `ruff format --check polylogue/ tests/ devtools/` — clean
- `ruff check polylogue/ tests/ devtools/` — clean
- `mypy polylogue/artifacts/` — clean
- `pytest tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py` — 12 passed
- Earlier full-dir pytest (1038 passed, 1 expected failure now resolved by restoring read_fields.py)
- `python -c "from polylogue.artifacts import ArtifactLayer, ArtifactNode, ArtifactPath, RUNTIME_ARTIFACT_NODES, RUNTIME_ARTIFACT_PATHS, build_runtime_artifact_nodes, build_runtime_artifact_paths"` — imports OK

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings May 3, 2026 11:22
@Sinity
Sinity merged commit 3a7483d into master May 3, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the feature/chore/slice-a-clean-baseline branch May 3, 2026 11:22
@coderabbitai

coderabbitai Bot commented May 3, 2026 •

Copy link
Copy Markdown

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: 8655e3a9-0efa-42de-80d0-db8a2b032c7e

📥 Commits

Reviewing files that changed from the base of the PR and between cb51b2a and 5156b31.

📒 Files selected for processing (9)
  • docs/verification-catalog.md
  • polylogue/artifacts/__init__.py
  • polylogue/artifacts/descriptors.py
  • polylogue/artifacts/runtime.py
  • polylogue/cli/insights_rendering.py
  • polylogue/cli/shared/qa_finalization.py
  • polylogue/showcase/context.py
  • tests/unit/cli/test_insights_helper_runtime.py
  • tests/unit/cli/test_qa_finalization.py

📝 Walkthrough

Walkthrough

The PR refactors the artifact system into separate, typed modules and removes obsolete CLI/showcase components. It extracts artifact descriptor models and runtime graph definitions into dedicated modules, converts the main artifacts module to a re-export surface, updates documentation references, and deletes five modules that no longer fit the architecture.

Changes

Artifact System Refactoring

Layer / File(s) Summary
Type Definitions
polylogue/artifacts/descriptors.py
Introduces ArtifactLayer enum and frozen dataclasses ArtifactNode (with dependencies, code references, readiness/repair metadata) and ArtifactPath (grouping ordered node sequences), each with to_dict() JSON serializers.
Runtime Graph
polylogue/artifacts/runtime.py
Defines RUNTIME_ARTIFACT_NODES tuple (1000\+ ArtifactNode entries across source/durable/derived/index/projection layers) and RUNTIME_ARTIFACT_PATHS tuple (named end-to-end execution/query/publication/repair loops), plus accessor functions.
Module Reorganization
polylogue/artifacts/__init__.py
Converts from inline definitions to import-and-re-export module; __all__ and build function signatures unchanged; delegates implementation to descriptors and runtime submodules.
Documentation
docs/verification-catalog.md
Updates line number references for polylogue run stage subcommands in "Command Subjects" table to match new locations in polylogue/cli/commands/run.py.

CLI and Showcase Module Deletions

Layer / File(s) Summary
CLI Modules Removed
polylogue/cli/insights_rendering.py, polylogue/cli/shared/qa_finalization.py
Deletes archive-insight serialization helpers (model_payload, emit_product_list, summarize_archive_debt) and QA post-run orchestration logic (VHS capture, JSON/summary rendering, snapshot plan execution).
Showcase Module Removed
polylogue/showcase/context.py
Removes ShowcaseContext immutable dataclass and factory constructors (synthetic, live, source, existing) for workspace/archive context management.
Associated Tests Removed
tests/unit/cli/test_insights_helper_runtime.py, tests/unit/cli/test_qa_finalization.py
Deletes unit tests validating serialization payloads, product list emission, archive debt aggregation, and QA finalization workflows.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • PR #353: Overlaps in CLI surface, verification/showcase artifact entries, and generation/showcase functionality updates across the same modules.

Suggested labels

type:chore, type:refactor, area:cli, area:storage, area:qa

Poem

🐰 Artifacts dance in ordered rows,
Typed descriptors, runtime flows,
Old modules fade as structures shine,
Refactored clean, the graph's design!
Quality code, neat and bright,
Our warren hops with pure delight! ✨

✨ 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/chore/slice-a-clean-baseline

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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: 5156b312e0

ℹ️ 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/insights_rendering.py Resolved
@Sinity
Sinity removed the request for review from Copilot May 3, 2026 11:45
Sinity added a commit that referenced this pull request May 3, 2026
…anup (#634) (#765)

Remove 3 stale topology entries for files deleted in #752
(showcase/context.py, insights_rendering.py, qa_finalization.py).
Regenerate topology-status.md. lib/ → archive/ migration done.
storage/backends → sqlite done. products → insights done. Closing #634.

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
Sinity added a commit that referenced this pull request May 7, 2026
….py (#599, #729) (#752)

## Summary
Drops 3 confirmed-dead production modules and splits the 1072-line
`polylogue/artifacts/__init__.py` into 3 files.

## Problem
- `polylogue/artifacts/__init__.py` had grown to 1072 lines mixing type
definitions with runtime graph data (#599)
- Static analysis (#729) identified 5 candidates; 3 are truly dead

## Solution
### #599 — split artifacts/__init__.py
- `descriptors.py` (60 lines), `runtime.py` (1005 lines), `__init__.py`
(21 lines re-export shim)

### #729 — delete dead modules  
- `showcase/context.py`, `cli/insights_rendering.py`,
`cli/shared/qa_finalization.py` + dependent tests

Kept: `schema_command_support.py` (used by devtools), `read_fields.py`
(load-bearing; subsumed by #621)

## Verification
- ruff/mypy/import smoke — clean

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request May 7, 2026
…anup (#634) (#765)

Remove 3 stale topology entries for files deleted in #752
(showcase/context.py, insights_rendering.py, qa_finalization.py).
Regenerate topology-status.md. lib/ → archive/ migration done.
storage/backends → sqlite done. products → insights done. Closing #634.

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
@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