Repository navigation
chore(topology): resolve projection TBDs, conflicts, and missing rules - #502
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 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 |
#505) ## Summary Master CI has been red since 6b5c392 (#489) due to 14 unrelated test failures. This PR fixes them all in one mechanical pass so the architecture-series PRs (#502 and follow-ups) can land. ## Problem Failures span four root causes: 1. **Python 3.11 / pydantic TypedDict.** Pydantic 2.12+ refuses `typing.TypedDict` on Python < 3.12. 19 modules declare TypedDict subclasses; they all need to import from `typing_extensions`. 2. **MCP mutation tests don't mock the new resolve_id pre-check.** Mutation tools resolve the conversation_id via the query store before mutating; tests only patched `_get_tag_store`, so resolve_id returned None and the tools short-circuited with "conversation not found". 3. **Schema/contract drift.** `_clamp_limit` caps at 1000 but tests still echo unbounded inputs. `get_stats_by` gained an enum on `group_by` but the witness wasn't regenerated. `bulk_tag_conversations` switched to `bulk_add_tags(ids, tags)` but the test still asserts N×M `add_tag` awaits. 4. **Env-sensitive logging test.** `configure_logging` honors `POLYLOGUE_FORCE_PLAIN`; CI sets that env to `1`, so `ConsoleRenderer(colors=True)` is unreachable from inside CI. ## Solution Six targeted fixes: 1. Switch 19 files from `typing.TypedDict` to `typing_extensions.TypedDict`. Add `typing-extensions>=4.7` to `pyproject.toml` (works on all supported Pythons). 2. Add `resolved_id` parameter to `make_query_store_mock` and patch `_get_query_store` in affected mutation tests (`add_tag`, `remove_tag`, `set_metadata`, `delete_metadata`, `delete_conversation`). 3. Update `_clamp_limit` parametrized cases (5000/10001/99999 → 1000); regen `tests/data/witnesses/mcp-tool-schemas.json`; rewrite bulk_tag test to assert on `bulk_add_tags`. 4. Add `patch.dict("os.environ")` + `env.pop("POLYLOGUE_FORCE_PLAIN")` to the logging test. 5. Refresh syrupy `test_terminal_snapshots.ambr` (same drift as #503; included here to make the unit suite green standalone). ## Verification ``` POLYLOGUE_FORCE_PLAIN=1 pytest tests/unit/mcp/ \ tests/unit/test_logging_runtime.py \ tests/unit/cli/test_terminal_snapshots.py --no-cov → all pass devtools verify --quick → all checks passed (pre-push hook) ``` ## Out of scope `test_cli_tail_list_json_exposes_tail_provenance` is failing on a TOCTOU warning from a parallel BlobStore fix (in `feature/fix/audit-final` / d295503). Tracked there; not in this PR. ## Related - #503 — baseline + syrupy refresh; this PR includes the syrupy bit again so master test suite is green even without #503. - #502 — topology projection cleanup; blocked on master CI being green. - #489 — the merge that introduced the 14 failures (test code wasn't updated alongside MCP authz/limits + clamp_limit + bulk_add_tags + the show/export help text changes that landed across several merges). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Enhanced CLI help text for export and show commands with clearer descriptions of conversation ID format handling and default output behavior. * Reordered MCP tool schema parameters with added validation constraints. * **Chores** * Added `typing-extensions>=4.7` as a runtime dependency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Problem ------- The topology projection had 39 TBD cells (no target rule) and 3 target collisions where two source paths claimed the same destination: - lib/conversation/models.py (attachment_models.py + conversation_models.py) - storage/repository/archive/reads.py (repository_action_reads.py + repository_archive_reads.py) - storage/repository/archive/conversations.py (repository_archive_conversations.py + repository_write_conversations.py) These prevent verify-topology from honestly scoring per-issue progress and let two refactor PRs accidentally claim the same target. What changed ------------ 1. Conflict splits in `STORAGE_PREFIX_TO_SUBPACKAGE`: - `repository_action_` -> `storage/repository/action/` - `repository_write_` -> `storage/repository/archive/writes/` 2. Conflict split in `LIB_PREFIX_TO_SUBPACKAGE`: - `attachment_` -> `lib/attachment/` (was `lib/conversation/`) 3. New `LIB_PREFIX_TO_SUBPACKAGE` rules for the 9 #424 lib TBDs: - `phase_`, `projection_`, `projections`, `provider_` 4. New `LIB_ROOT_PRIMITIVES` entries for 2 standalone lib primitives: - `pricing.py`, `payload_coercion.py` 5. New explicit `SHOWCASE_MOVES` table for 30 #413 showcase TBDs, classified per the issue body (substrate -> polylogue/scenarios/; runner machinery -> devtools/lab_runner/; reporting -> devtools/lab_report/; lab corpus -> devtools/lab_corpus/). 6. New `TARGET_TO_ISSUE` entries for the new lib subpackages introduced above (`lib/phase/`, `lib/projection/`, `lib/provider/`, `lib/attachment/`). After regenerating: TBDs drop 39 -> 0; target conflicts drop 3 -> 0; every cell carries an explicit owner. Verification ------------ python3 devtools/build_topology_projection.py Wrote 641 rows. TBD: 0. devtools verify --quick all checks passed (verify-topology, verify-file-budgets, verify-test-ownership, verify-migrations, verify-cross-cuts). No code moves; this PR only adjusts the topology generator and the generated YAML + dashboard. Subsequent move PRs (per-issue) will land files at the declared targets. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
852d229 to
4b2629b
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
#505) ## Summary Master CI has been red since ddf212f (#489) due to 14 unrelated test failures. This PR fixes them all in one mechanical pass so the architecture-series PRs (#502 and follow-ups) can land. ## Problem Failures span four root causes: 1. **Python 3.11 / pydantic TypedDict.** Pydantic 2.12+ refuses `typing.TypedDict` on Python < 3.12. 19 modules declare TypedDict subclasses; they all need to import from `typing_extensions`. 2. **MCP mutation tests don't mock the new resolve_id pre-check.** Mutation tools resolve the conversation_id via the query store before mutating; tests only patched `_get_tag_store`, so resolve_id returned None and the tools short-circuited with "conversation not found". 3. **Schema/contract drift.** `_clamp_limit` caps at 1000 but tests still echo unbounded inputs. `get_stats_by` gained an enum on `group_by` but the witness wasn't regenerated. `bulk_tag_conversations` switched to `bulk_add_tags(ids, tags)` but the test still asserts N×M `add_tag` awaits. 4. **Env-sensitive logging test.** `configure_logging` honors `POLYLOGUE_FORCE_PLAIN`; CI sets that env to `1`, so `ConsoleRenderer(colors=True)` is unreachable from inside CI. ## Solution Six targeted fixes: 1. Switch 19 files from `typing.TypedDict` to `typing_extensions.TypedDict`. Add `typing-extensions>=4.7` to `pyproject.toml` (works on all supported Pythons). 2. Add `resolved_id` parameter to `make_query_store_mock` and patch `_get_query_store` in affected mutation tests (`add_tag`, `remove_tag`, `set_metadata`, `delete_metadata`, `delete_conversation`). 3. Update `_clamp_limit` parametrized cases (5000/10001/99999 → 1000); regen `tests/data/witnesses/mcp-tool-schemas.json`; rewrite bulk_tag test to assert on `bulk_add_tags`. 4. Add `patch.dict("os.environ")` + `env.pop("POLYLOGUE_FORCE_PLAIN")` to the logging test. 5. Refresh syrupy `test_terminal_snapshots.ambr` (same drift as #503; included here to make the unit suite green standalone). ## Verification ``` POLYLOGUE_FORCE_PLAIN=1 pytest tests/unit/mcp/ \ tests/unit/test_logging_runtime.py \ tests/unit/cli/test_terminal_snapshots.py --no-cov → all pass devtools verify --quick → all checks passed (pre-push hook) ``` ## Out of scope `test_cli_tail_list_json_exposes_tail_provenance` is failing on a TOCTOU warning from a parallel BlobStore fix (in `feature/fix/audit-final` / d295503). Tracked there; not in this PR. ## Related - #503 — baseline + syrupy refresh; this PR includes the syrupy bit again so master test suite is green even without #503. - #502 — topology projection cleanup; blocked on master CI being green. - #489 — the merge that introduced the 14 failures (test code wasn't updated alongside MCP authz/limits + clamp_limit + bulk_add_tags + the show/export help text changes that landed across several merges). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Enhanced CLI help text for export and show commands with clearer descriptions of conversation ID format handling and default output behavior. * Reordered MCP tool schema parameters with added validation constraints. * **Chores** * Added `typing-extensions>=4.7` as a runtime dependency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
#502) ## Summary Closes the projection-cleanup prerequisite for the architecture series. Resolves 39 TBD cells and 3 target conflicts in `docs/plans/topology-target.yaml` so `verify-topology` and `render-topology-status` produce honest per-issue progress numbers. No code moves. ## Problem The generated topology projection had: - **39 TBD cells** (30 in `polylogue/showcase/`, 9 in `polylogue/lib/`) with no target rule. - **3 target conflicts** where two source paths claimed the same destination: - `lib/conversation/models.py` ← `attachment_models.py` + `conversation_models.py` - `storage/repository/archive/reads.py` ← `repository_action_reads.py` + `repository_archive_reads.py` - `storage/repository/archive/conversations.py` ← `repository_archive_conversations.py` + `repository_write_conversations.py` These prevented `verify-topology` from scoring per-issue progress honestly and let two refactor PRs accidentally claim the same destination. ## Solution Six edits to `devtools/build_topology_projection.py`, all to placement rules. The YAML is regenerated; no source code is moved. 1. **Storage conflict splits** in `STORAGE_PREFIX_TO_SUBPACKAGE`: - `repository_action_` → `storage/repository/action/` (was `storage/repository/archive/`) - `repository_write_` → `storage/repository/archive/writes/` (was `storage/repository/archive/`) 2. **Lib conflict split** in `LIB_PREFIX_TO_SUBPACKAGE`: - `attachment_` → `lib/attachment/` (was `lib/conversation/`) 3. **New `LIB_PREFIX_TO_SUBPACKAGE` rules** for the 9 #424 lib TBDs: - `phase_`, `projection_`, `projections`, `provider_` 4. **New `LIB_ROOT_PRIMITIVES` entries** for 2 standalone lib primitives: - `pricing.py`, `payload_coercion.py` 5. **New `SHOWCASE_MOVES` table** for the 30 #413 showcase TBDs, classified per the issue body — substrate to `polylogue/scenarios/`, runner machinery to `devtools/lab_runner/`, reporting to `devtools/lab_report/`, lab corpus to `devtools/lab_corpus/`. Files leave the projection on move (target paths under `devtools/` are forward-looking annotations). 6. **New `TARGET_TO_ISSUE` entries** for `lib/phase/`, `lib/projection/`, `lib/provider/`, `lib/attachment/` so they attribute to #424. ## Verification ``` python3 devtools/build_topology_projection.py Wrote 641 rows. TBD: 0. devtools verify --quick ruff format ... ok ruff check ... ok mypy ... ok render-all ... ok verify-topology ... ok verify-file-budgets ... ok verify-test-ownership ... ok verify-migrations ... ok verify-cross-cuts ... ok all checks passed ``` Per-issue dashboard after this PR: | Issue | Cells | At target | Pending | Conflicts | | --- | --: | --: | --: | --: | | #403 | 16 | 0 | 16 | 0 | | #413 | 30 | 0 | 30 | 0 | | #414 | 8 | 0 | 8 | 0 | | #424 | 64 | 0 | 64 | 0 | | #425 | 63 | 0 | 63 | 0 | | #426 | 15 | 0 | 15 | 0 | TBDs: 39 → 0. Conflicts: 3 → 0. ## Risks and Follow-ups This PR contains no code moves and changes only generator placement rules + the regenerated YAML/dashboard. Subsequent move PRs land files at these targets: - #414 (8 cells) is the smallest concrete first move, recommended next. - #426, #403, #413 can run in parallel afterwards. - #424, #425 should sequence by sub-cluster, since each is multi-PR. - #420 and #431 still have no cells declared — separate prerequisite work. Ref #429 (executable topology), #424, #425, #413. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Closes the projection-cleanup prerequisite for the architecture series. Resolves 39 TBD cells and 3 target conflicts in
docs/plans/topology-target.yamlsoverify-topologyandrender-topology-statusproduce honest per-issue progress numbers. No code moves.Problem
The generated topology projection had:
polylogue/showcase/, 9 inpolylogue/lib/) with no target rule.lib/conversation/models.py←attachment_models.py+conversation_models.pystorage/repository/archive/reads.py←repository_action_reads.py+repository_archive_reads.pystorage/repository/archive/conversations.py←repository_archive_conversations.py+repository_write_conversations.pyThese prevented
verify-topologyfrom scoring per-issue progress honestly and let two refactor PRs accidentally claim the same destination.Solution
Six edits to
devtools/build_topology_projection.py, all to placement rules. The YAML is regenerated; no source code is moved.Storage conflict splits in
STORAGE_PREFIX_TO_SUBPACKAGE:repository_action_→storage/repository/action/(wasstorage/repository/archive/)repository_write_→storage/repository/archive/writes/(wasstorage/repository/archive/)Lib conflict split in
LIB_PREFIX_TO_SUBPACKAGE:attachment_→lib/attachment/(waslib/conversation/)New
LIB_PREFIX_TO_SUBPACKAGErules for the 9 refactor(lib): group lib by domain cluster #424 lib TBDs:phase_,projection_,projections,provider_New
LIB_ROOT_PRIMITIVESentries for 2 standalone lib primitives:pricing.py,payload_coercion.pyNew
SHOWCASE_MOVEStable for the 30 refactor: retire public audit qa showcase surfaces #413 showcase TBDs, classified per the issue body — substrate topolylogue/scenarios/, runner machinery todevtools/lab_runner/, reporting todevtools/lab_report/, lab corpus todevtools/lab_corpus/. Files leave the projection on move (target paths underdevtools/are forward-looking annotations).New
TARGET_TO_ISSUEentries forlib/phase/,lib/projection/,lib/provider/,lib/attachment/so they attribute to refactor(lib): group lib by domain cluster #424.Verification
Per-issue dashboard after this PR:
TBDs: 39 → 0. Conflicts: 3 → 0.
Risks and Follow-ups
This PR contains no code moves and changes only generator placement rules + the regenerated YAML/dashboard. Subsequent move PRs land files at these targets:
Ref #429 (executable topology), #424, #425, #413.