Repository navigation
refactor: session/origin vocabulary sweep + public-surface static audit (#1810) - #1852
Conversation
Co-Authored-By: Claude <[email protected]>
Problem
-------
Schema-v1 fixed Polylogue's public vocabulary to `session` and `origin`, but
nothing prevents stale `conversation`/`conversation_id`, the legacy `/c/{id}`
reader route, or `provider_meta` from reappearing on public surfaces (README,
hand-authored docs, daemon web reader, API, CLI). The route rename in the
prior commit also left three stale `/c/{id}` references in docs.
What changed
------------
- tools/cleanup/polylogue_public_surface_audit.sh: path-aware ripgrep audit
that fails on stale schema-v1 tokens in public surfaces, with replacement
guidance per hit. Allowlists provider-wire parsers, internal storage/core,
tests, historical/tombstone docs, and docs/providers (external wire notes);
supports an inline `polylogue-audit: allow` marker for external-format docs.
It deliberately does not police bare `provider` (deferred internal rename,
Ref #1835) or `blocks` (Ref #1791).
- devtools/verify.py: wired the audit into the non-pytest gate set so it runs
in `devtools verify --quick` and the default tier.
- tests/unit/devtools/test_public_surface_audit.py: positive (clean tree),
negative (conversation_id / legacy route / provider_meta), provider-wire
allowlist, and inline-allow-marker coverage.
- docs/visual-evidence.md: `/c/{id}` -> `/s/{id}` (stale after the route rename).
Ref #1810 #1835 #1850
Co-Authored-By: Claude <[email protected]>
The pre-push verify gate was red on master with 9 `var-annotated` errors in three daemon test stub classes (backend/config/voyage_api_key/auth_token set to None without a declared type). These are inherited (not caused by the session/origin sweep) but block the pre-push gate; annotating the stubs with their obvious optional types clears mypy with no behavior change. Co-Authored-By: Claude <[email protected]>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR migrates the reader and daemon from legacy conversation-based routing ( ChangesSchema v1 to v2 Vocabulary Migration and Public Surface Audit
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 63dac12da9
ℹ️ 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 the public-surface stale-vocabulary audit to the CI `lint` job so stale schema-v1 terminology cannot be reintroduced on a public surface and pass CI. ## Problem The audit (`tools/cleanup/polylogue_public_surface_audit.sh`) landed in #1852 and runs in `devtools verify` / the pre-push hook, but **CI never invoked it**. A PR reintroducing `conversation`/`conversation_id`, `provider_meta`, or the legacy `/c/` reader route on the README, public docs, daemon web reader, API layer, or CLI would pass CI. #1850 requires the audit to run in fast CI. ## Solution One step added to the CI `lint` job (after the ruff checks): `bash tools/cleanup/polylogue_public_surface_audit.sh`. The audit is path-aware — it excludes provider-wire parsers (`polylogue/sources/**`), internal storage/core, tests/fixtures, and historical/tombstone docs (`docs/{audits,retro,design,plans,providers}/**`) — and exits non-zero naming `file:line` + the replacement term. `ripgrep` is preinstalled on GitHub `ubuntu-latest`. ## Verification - `devtools verify-ci-workflows` → `16 workflow files checked, no errors` - `bash tools/cleanup/polylogue_public_surface_audit.sh` → `clean (no stale schema-v1 vocabulary on public surfaces)` Closes #1850 Co-authored-by: Claude Opus 4.8 <[email protected]>
#1867) ## Summary Rename the `read --view conversation` token to `transcript` to remove stale "conversation" vocabulary that #1863 reintroduced on public CLI surfaces, restoring the session/origin vocabulary policy from the #1810/#1852 sweep. ## Problem #1863 shipped `read --view conversation`. The public-surface audit (`tools/cleanup/polylogue_public_surface_audit.sh`, #1852) flags `conversation` as stale schema-v1 vocabulary on both `polylogue/cli/query_verbs.py` and the generated `docs/cli-reference.md`. The audit **false-passed in CI** — the Ubuntu-image ripgrep silently mishandles the audit's `rg` invocation (the #1854/#1855 shelled-binary-in-CI fragility) — so the violation landed on master uncaught. It deterministically fails the local pre-push gate (nix ripgrep), blocking every subsequent push. ## Solution - Rename the read view token `conversation` → `transcript` in `query_verbs.py` (`_READ_VIEWS`, help text, comment). The view has no distinct dispatch branch — it shares the summary fallthrough render path — so this is a pure token rename, no behavior change. - Regenerate `docs/cli-reference.md` and the `help-read.txt` showcase baseline. ## Verification - `tools/cleanup/polylogue_public_surface_audit.sh` → exit 0 (`clean (no stale schema-v1 vocabulary on public surfaces)`) - `mypy --strict polylogue/cli/query_verbs.py` → clean - `ruff check` → clean - `pytest tests/unit/cli -k "help or read or view"` → 433 passed, 4 snapshots passed ## Follow-up The CI audit's ripgrep false-pass is a real gap (CI did not catch this violation). The lint job's `rg` invocation hardening against the runner image is tracked separately (#1855 class).
|
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. |
|
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
Coherent first slice of the schema-v1 session/origin terminology sweep: renames the stale
/c/{conversation_id}HTML reader route to/s/{session_id}across the daemon web shell, and adds a path-aware static audit (tools/cleanup/polylogue_public_surface_audit.sh, #1850) that fails CI when stale schema-v1 vocabulary reappears on a public surface. This is intentionally partial — see Deferred below; it is being merged as the first reviewable slice so the branch can clear the worktree for follow-up work from clean master.Problem
Schema-v1 fixed Polylogue's public vocabulary to
sessionandorigin, but the daemon still served the legacy/c/{conversation_id}reader route (JS regex, link construction, and HTTP dispatch), and nothing prevented staleconversation/conversation_id/provider_metaterms or the dead route from reappearing on public surfaces (README, hand-authored docs, web reader, API, CLI). The audit onorigin/masterfinds 8 public-surface hits (the/c/reader route inweb_shell*.pyplus 3 stale/c/{id}references indocs/visual-evidence.md).Solution
polylogue/daemon/http.py,web_shell*.py):/c/{id}→/s/{id};getConvIdFromURL→getSessionIdFromURL; all link/href/pushState/hash sites updated. No compatibility alias (pre-release, single-user — delete+replace).tools/cleanup/polylogue_public_surface_audit.sh, Polylogue: stale vocabulary and command-surface static audit #1850): ripgrep-based, path-aware. Fails onconversation/conversation_id/conversationId/provider_meta//c/literals in public surfaces (root README, non-historical docs, daemon web, API, CLI), names eachfile:linewith replacement guidance. Allowlists provider-wire parsers (polylogue/sources/**), internal storage/core/schema, tests, historical/tombstone docs (audits/retro/design/plans), anddocs/providers/**(external wire notes). Supports an inlinepolylogue-audit: allow <reason>marker. Deliberately does not police bareprovider(deferred internal rename) orblocks(Rename content_blocks -> blocks in runtime models and tests (post-#1743) #1791). Wired into thedevtools verify --quicknon-pytest gate set.docs/visual-evidence.md):/c/{id}→/s/{id}(stale after the route rename)./s/{id}serves the shell;/c/{id}is 404, no alias); audit tests (clean tree passes;conversation_id/legacy-route/provider_metafail; provider-wire allowlist; inline-allow marker).fix(tests):commit): annotated 9 pre-existingvar-annotatedmypy errors in three daemon test stub classes that were red onmasterand blocked the pre-push gate. Not part of the sweep; zero behavior change.Verification
Baseline before this branch:
devtools verify --quickwas 13/14 (mypy red with 9 inherited errors). Final: 15/15 green.Before / after stale terms (public surfaces)
/c/reader route literals (polylogue/py)/c/{id}indocs/visual-evidence.mdDeferred (next agent, from clean master)
provider→origininternal rename (~6024 hits in storage/query/schema behindorigin↔providerboundary translation). Schema-migration-scale; public JSON/query API already speaksorigin. Audit allowlists these paths. Ref #1835.provider_metarestructure into typed origin-specific fields. Field is used in ~40 internal files; the audit only polices it on public text surfaces. (#1790 does not resolve to an issue in this repo — GraphQL 404 — so its plan could not be consulted.)content_blocks→blocks(Rename content_blocks -> blocks in runtime models and tests (post-#1743) #1791) — separate ~133-file mechanical rename with its own plan; out of session/origin scope. Audit does not policeblocks.show/open/messages/raw/export/bulk-export/recent/count/stats), the fate ofpolylogue/rendering/*andpolylogue/templates/*, and proof/QA/showcase confidence-language cleanup.browser-extension/README.mdgeneric/external-productconversationprose (anchored out of the README glob; separate component surface).Ref #1810 #1835 #1850
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Updates
/c/{id}to/s/{id}.Tests