Repository navigation
fix: make deployed Polylogue smoke trustworthy - #2303
Conversation
Problem: deployed probes exposed three small operator-facing defects: the Nix package omitted the query parser dependency, polylogued lacked the version option available on polylogue, and read help leaked maintainer-only PR wording.\n\nWhat changed: add lark to the Nix package closure, wire polylogued --version through the shared runtime version, and make the reserved read-view help text user-facing.\n\nVerification: devtools test tests/unit/daemon/test_daemon_cli.py::test_polylogued_version_option_reports_version tests/unit/daemon/test_daemon_cli.py::test_polylogued_help_lists_watch_command tests/unit/cli/test_exit_code_contracts.py::TestSuccessExitCode::test_read_help_exits_zero; nix build .#polylogue -o .local/result-probe-polish; POLYLOGUE_ARCHIVE_ROOT=/realm/tmp/polylogue-empty-smoke ./.local/result-probe-polish/bin/polylogue --diagnose find "repo:polylogue" --limit 1 --format json no longer fails with ModuleNotFoundError for lark.
Problem: the browser-capture receiver accepted fresh ChatGPT snapshots into the local spool, but the daemon's default watcher never observed that spool and status reported the default receiver as active in one field while inactive in another. Captured sessions could therefore appear successful at the receiver boundary without becoming archive/query rows.\n\nWhat changed: add the browser-capture spool as a default JSON live source and resolve the default receiver spool before deriving daemon browser-capture status flags. Focused tests lock the default source and status envelope contracts.\n\nVerification: devtools test tests/unit/sources/test_live_watcher.py::test_browser_capture_spool_is_default_json_source tests/unit/sources/test_live_watcher.py::test_inbox_source_accepts_zip_and_archive_formats tests/unit/daemon/test_daemon_status.py::test_daemon_status_uses_default_browser_capture_spool; ruff check polylogue/daemon/status.py polylogue/sources/live/watcher.py tests/unit/sources/test_live_watcher.py tests/unit/daemon/test_daemon_status.py
Problem: live Polylogue probing repeatedly found deployed-state skew between systemwide binaries, daemon routes, and browser-capture receiver status. Those checks were ad hoc, easy to run from the wrong PATH, and not captured by the existing branch-local dev-loop preflight.\n\nWhat changed: add devtools workspace deployment-smoke, which resolves systemwide polylogue/polylogued binaries with a sanitized PATH and probes /api/status, /api/read-view-profiles, and /v1/status. The command emits human or JSON reports and exits non-zero when required probes fail. The command catalog and generated devtools references include the new workspace command.\n\nVerification: devtools test tests/unit/devtools/test_deployment_smoke.py tests/unit/devtools/test_devtools_main.py::test_list_commands_json_includes_generated_surface tests/unit/devtools/test_devtools_main.py::test_list_commands_human_output; devtools verify --quick; devtools workspace deployment-smoke --json (expected live failure on stale deployed daemon).
Problem: live deployment probing included CLI/API/browser-capture checks, but shell-completion health still required agents to hand-assemble Click completion environment variables. That made an important query-action affordance easy to skip during deployed UX checks.\n\nWhat changed: add a completions section to the deployment smoke report for the main find-then-action workflow: then connector, action verb, read views, and view-scoped message formats. Completion failures now appear in the smoke failures list with missing candidates.\n\nVerification: devtools test tests/unit/devtools/test_deployment_smoke.py; devtools workspace deployment-smoke --json; devtools verify --quick
Problem: deployed web UI probes showed the session list route was fast while /api/facets could take more than 100 seconds, but deployment smoke did not exercise either web-shell data route. Agents had to rediscover the bottleneck manually.\n\nWhat changed: include /api/sessions?limit=1&offset=0 and /api/facets in the deployment smoke route set. Facet route failures now get a specific diagnostic and next action pointing at profiling and cached or bounded aggregation.\n\nVerification: devtools test tests/unit/devtools/test_deployment_smoke.py; devtools render all --check; devtools workspace deployment-smoke --json --timeout-s 5; devtools verify --quick
Problem: the browser-capture receiver could be active and writing JSON artifacts while the deployed archive had zero raw rows for those captures. Deployment smoke only checked the receiver route, so this spooled-only failure mode stayed invisible.\n\nWhat changed: add a browser-capture archive consistency probe to deployment smoke. It counts spooled capture JSON files under the archive root and compares them with raw_sessions rows whose source_path comes from browser-capture, reporting spooled_without_raw_rows when captured artifacts have not materialized into source.db.\n\nVerification: devtools test tests/unit/devtools/test_deployment_smoke.py; devtools workspace deployment-smoke --json --timeout-s 5; devtools verify --quick
Problem: after removing the showcase verification layer, a generic insight-transform test still used showcase-verify as its synthetic failed CI check name. That kept stale terminology showing up in repo hygiene searches even though the test was not about showcase behavior.\n\nWhat changed: rename the synthetic failed check to deployment-smoke and update the expected extracted event summary.\n\nVerification: devtools test tests/unit/insights/test_transforms.py::test_github_cli_and_failed_check_events_are_extracted; devtools verify --quick
Problem: the deployment smoke check only noticed the case where browser capture files were spooled but no raw archive rows existed. Once raw rows exist, a newer capture can still be stranded in the spool while the check reports success. What changed: record the latest spooled capture mtime in milliseconds, compare it with the newest browser-capture raw row mtime, and report a distinct spooled_newer_than_raw_rows failure. Add focused SQLite-backed tests for empty, stale, and current browser-capture archive states. Verification: ruff check devtools/deployment_smoke.py tests/unit/devtools/test_deployment_smoke.py; devtools test tests/unit/devtools/test_deployment_smoke.py; devtools verify --quick; devtools workspace deployment-smoke --json --timeout-s 5.
Problem: deployment smoke checked receiver liveness and local spool/raw-row consistency, but it did not verify the receiver archive-state DTO for a spooled capture. Live probing showed the deployed receiver reports captured=true with an absolute artifact_path while the current source contract uses relative artifact_ref. What changed: derive provider/session identity from the latest spooled capture, query /v1/archive-state read-only with an extension Origin header, and report stale absolute-path or missing artifact-ref contracts as browser-capture receiver archive-state failures. Add focused tests for current and stale DTO shapes. Verification: ruff check devtools/deployment_smoke.py tests/unit/devtools/test_deployment_smoke.py; devtools test tests/unit/devtools/test_deployment_smoke.py; devtools verify --quick; devtools workspace deployment-smoke --json --timeout-s 5.
Problem: the deployment-smoke command description still only mentioned binaries, daemon routes, and receiver liveness, even though the command now probes web routes, browser-capture raw archive materialization, and receiver archive-state contracts. What changed: update the command catalog wording and regenerate docs/devtools.md so command discovery reflects the expanded deployed-state check. Verification: ruff check devtools/command_catalog.py; devtools render devtools-reference; devtools render all --check; devtools verify --quick.
Problem: regenerating agent docs after the deployment-smoke catalog wording change updated the rendered command summary in AGENTS.md. What changed: commit the generated AGENTS.md line so rendered agent guidance matches docs/devtools.md and the command catalog. Verification: devtools render all --check; devtools verify --quick.
Problem: deployment smoke only exercised JSON API routes, so a web-shell browser failure could be confused with the daemon failing to serve the root workbench document. Live probing showed the root HTML returned quickly while browser navigation still hung on bootstrap work.\n\nWhat changed: include / in the web-route smoke set, preserve route content type and byte size, and allow successful non-JSON route bodies to be reported with a preview instead of failing JSON parsing.\n\nVerification: devtools test tests/unit/devtools/test_deployment_smoke.py; devtools verify --quick
Problem: route-level deployment smoke can prove the daemon serves the web root, but it could not reproduce the browser first-paint hang observed against the deployed workbench. That left browser-level evidence in manual notes only.\n\nWhat changed: add an opt-in --browser probe that launches headless Chrome with a temporary profile, captures DOM/screenshot byte counts, and reports structured browser-render failures without making the default smoke slower. The command catalog now shows the Nix-profile Chrome executable form used on this host.\n\nVerification: devtools test tests/unit/devtools/test_deployment_smoke.py; devtools verify --quick; devtools workspace deployment-smoke --json --timeout-s 5 --browser --browser-timeout-s 12 --browser-executable /etc/profiles/per-user/sinity/bin/google-chrome
Problem: the browser-capture docs described DOM scraping as the chosen capture strategy even though live ChatGPT probing showed the authenticated page exposes a richer provider-native conversation payload. That wording would steer future work toward a lossy fallback.\n\nWhat changed: update the architecture spine, browser-capture docs, and extension README to describe provider adapters that prefer structured app/page evidence and use DOM text only as a compatibility fallback.\n\nVerification: devtools render all --check.
Problem: restored split archives can have an indexed Codex session whose original source-tier raw row is missing, while the ingest cursor still points at an older byte offset. The append planner then cannot recover the native session id through the source-path join and falls back to full-file ingestion of very large Codex JSONL files. What changed: when the source-tier join misses for Codex, read the first JSONL session_meta record and use its id only if index.db already contains that native codex-session. This preserves bounded append planning without inventing identity from filenames or paths. Verification: devtools test tests/unit/sources/test_live_catchup_planning.py -q; ruff check polylogue/sources/live/batch.py tests/unit/sources/test_live_catchup_planning.py; ruff format --check polylogue/sources/live/batch.py tests/unit/sources/test_live_catchup_planning.py
Problem: deployed polylogued could spend sustained CPU in concurrent /api/health requests because the legacy health endpoint called archive readiness, which scans archive-scale tables on large restored databases. That made routine polling compete with live append ingest. What changed: make /api/health use a read-only sqlite_master reachability probe for its quick_check field. The explicit readiness surfaces still own archive/debt/FTS diagnostics. Add a daemon HTTP contract test that fails if /api/health calls archive readiness again. Verification: devtools test tests/unit/daemon/test_daemon_http_contracts.py -k health -q; ruff check polylogue/daemon/http.py tests/unit/daemon/test_daemon_http_contracts.py; ruff format --check polylogue/daemon/http.py tests/unit/daemon/test_daemon_http_contracts.py
Problem: deployment smoke treated browser-capture raw-row presence as enough evidence that a capture was archived. Live probing showed the latest ChatGPT capture had a source row but only a zero-message filename-derived session in index.db, so the smoke check reported green for the surface that mattered.\n\nWhat changed: extend the browser-capture archive probe to correlate the latest spooled artifact through source.db into index.db, report raw/index identity fields, and fail missing, zero-message, or native-id-mismatched materialization. Match source rows by the stable browser-capture artifact suffix so alternate active roots do not hide valid rows.\n\nVerification: devtools test tests/unit/devtools/test_deployment_smoke.py -q; ruff check devtools/deployment_smoke.py tests/unit/devtools/test_deployment_smoke.py; ruff format --check devtools/deployment_smoke.py tests/unit/devtools/test_deployment_smoke.py; python -m devtools.deployment_smoke --json --timeout-s 5 against the live archive now reports browser-capture-archive:latest_spooled_indexed_without_messages.
Problem: the live batch path decodes JSON files into a one-element payload list before dispatch. Browser-capture documents detected as ChatGPT then went through the normal ChatGPT bundle parser, producing a zero-message filename-derived placeholder instead of the provider-native captured session.\n\nWhat changed: teach provider detection and payload lowering to recognize list-wrapped browser-capture envelopes before bundle parsing, preserving the browser-capture parser path used by direct source imports.\n\nVerification: python probe against the live ChatGPT capture now parses provider_session_id=chatgpt:6a2ea930-87a8-83eb-adb7-4cf38ccaa6a3:6ab94510 with 78 messages; devtools test tests/unit/sources/test_browser_capture.py -q; ruff check polylogue/sources/dispatch.py tests/unit/sources/test_browser_capture.py; ruff format --check polylogue/sources/dispatch.py tests/unit/sources/test_browser_capture.py.
Problem: the deployment-smoke browser probe passed Chrome --timeout and --virtual-time-budget flags, which made the live Polylogue root produce no DOM or screenshot under the system Chrome even though the page could render normally without those flags. Chrome also writes artifacts but does not exit promptly on this host, so treating every timeout as failure hid useful evidence. What changed: remove Chrome's virtual-time flags from the one-shot render probe and classify timeout-after-capture as an ok browser-render caveat when both DOM and screenshot artifacts were produced. Add regression coverage for the timeout-after-capture path and for keeping those Chrome flags out of the command. Verification: devtools test tests/unit/devtools/test_deployment_smoke.py -q; ruff check devtools/deployment_smoke.py tests/unit/devtools/test_deployment_smoke.py; ruff format --check devtools/deployment_smoke.py tests/unit/devtools/test_deployment_smoke.py; python -m devtools.deployment_smoke --json --timeout-s 5 --browser --browser-timeout-s 12 --browser-executable /etc/profiles/per-user/sinity/bin/google-chrome.
📝 WalkthroughWalkthroughThis PR adds shared action-affordance contracts and surfaces, native browser-capture ingestion, daemon/runtime state wiring, deployment-smoke tooling, query-action workflow docs/help, and a repo-wide demo rename. ChangesIntegrated query-action, capture, runtime, and docs update
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related issues
Possibly related PRs
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 |
Problem: /api/status served the request-safe status snapshot, whose minimal payload hardcoded browser_capture_active=false and component_state.browser_capture=unknown while embedding a receiver payload that reported active=true. Live deployment smoke therefore saw contradictory browser-capture readiness even after the receiver and archive paths were repaired. What changed: record daemon component enablement at startup and use that process-local state when building bounded status snapshots. The minimal snapshot now keeps browser_capture.active, browser_capture_active, component_state.browser_capture, and component_readiness.browser_capture aligned without rebuilding rich archive status in the request path. Verification: devtools test tests/unit/daemon/test_daemon_status.py tests/unit/daemon/test_daemon_cli_remote_bind.py -q; ruff check polylogue/daemon/status_snapshot.py polylogue/daemon/cli.py tests/unit/daemon/test_daemon_status.py tests/unit/daemon/test_daemon_cli_remote_bind.py; ruff format --check polylogue/daemon/status_snapshot.py polylogue/daemon/cli.py tests/unit/daemon/test_daemon_status.py tests/unit/daemon/test_daemon_cli_remote_bind.py
Problem: the public showcase surface had been removed, but demo fixture generation still used a showcase style token, showcase file prefixes, a polylogue.schemas.synthetic.showcase module, and stale testing/docs references. The leftover names made repo hygiene checks and operator-facing docs look like the removed surface still existed. What changed: rename the curated synthetic style to demo, move the synthetic theme module to demo_themes, update demo workspace defaults and tests to write demo-prefixed fixtures, refresh topology/generated agent docs, and remove the orphan cli-command-surface witness file that no code consumed. Verification: devtools test tests/unit/core/test_synthetic_semantics.py tests/unit/demo/test_workspace.py tests/unit/scenarios/test_corpus.py -q; devtools render topology-projection && devtools render topology-status; devtools verify --quick; rg stale showcase/command-witness vocabulary.
Problem: the query-first CLI already exposes find QUERY then ACTION, but the product contract for cardinality, affordances, rendering, completions, browser capture fidelity, and cross-surface parity was spread across code, issues, and old design notes. What changed: add docs/design/query-action-workflows.md as the current implementation contract for #2305, link it from the design index, and register it in the generated README/docs map surface. Verification: devtools render all --check; devtools verify --quick.
Problem: the query-action workflow contract needs a source-level affordance DTO rather than only prose and Click command metadata. Existing ACTION_CONTRACTS powered completion, but did not carry target, safety, destinations, selection/confirmation commands, cost hints, or next actions. What changed: extend CliActionContract with JSON-native affordance payload metadata, publish action_affordance_payloads(), include safety/destination metadata in query-action completion descriptions, and render the expanded generated CLI action-contract table. Verification: devtools test tests/unit/cli/test_cli_action_contracts.py tests/unit/devtools/test_action_contract_report.py tests/unit/cli/test_command_aux_runtime.py::test_query_action_candidates_come_from_action_contracts_with_danger_metadata tests/unit/cli/test_completion_matrix.py::test_query_then_action_completion_per_shell tests/unit/cli/test_completion_matrix.py::test_query_action_completion_marks_destructive_actions_per_shell -q; devtools verify --quick.
Problem: the deployed probe of polylogue --diagnose invalid-xyz showed the strict-floor UsageError hint being appended with a corrupted command token because the generic No such command parser split a multi-line message by punctuation. What changed: extract quoted command names with a regex before falling back to token splitting, and cover the multi-line strict-floor message shape. Verification: devtools test tests/unit/cli/test_diagnose_and_error_discipline.py::TestUsageErrorHints::test_actionable_hint_for_no_such_command tests/unit/cli/test_diagnose_and_error_discipline.py::TestUsageErrorHints::test_actionable_hint_for_strict_floor_message_extracts_command_only; devtools verify --quick
2026-06-22 CLI probe follow-upAfter deploying Follow-up commits now on this PR:
Live deployed verification on
Local verification:
|
Problem: running the default seed-testmon baseline on the deployment-probe branch exposed residual gate failures: terminal help snapshots had not been refreshed for the find help line, the action-affordances config command missed the canonical -f alias, the minimal daemon status snapshot reported the actively-served API as unknown, and SQL audit line numbers drifted after user assertion helpers moved. What changed: add the -f alias, report daemon_api as running in minimal status snapshots when no explicit API flag is configured, refresh terminal dimension snapshots, and move audited SQL interpolation entries to the current assertion reader execute lines. Verification: devtools test tests/unit/storage/test_no_string_interpolated_sql.py::test_audited_sites_are_real_violations tests/unit/storage/test_no_string_interpolated_sql.py::test_no_unaudited_string_interpolated_sql tests/unit/cli/test_terminal_snapshots.py::TestTerminalDimensions::test_help_at_wide_width tests/unit/cli/test_terminal_snapshots.py::TestTerminalDimensions::test_help_at_narrow_width tests/unit/cli/test_theme_aliases_help_markdown.py::test_flag_aliases_consistent tests/unit/daemon/test_daemon_http_contracts.py::TestStatusEnvelopeContract::test_component_readiness_envelope_has_canonical_status_components; devtools verify --seed-testmon --skip-slow; devtools verify
|
@coderabbitai review |
✅ Action performedReview finished.
|
2026-06-22 baseline-gate repair and final deployed probeAfter taking the PR out of draft, I ran the repository baseline locally instead of relying only on quick gates. The first
Verification after the fix:
Live deploy through Sinnix override is now on
CodeRabbit review was requested after leaving draft and is currently in progress. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 07c2eeeb12
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
polylogue/sources/live/batch.py (1)
891-894:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPreserve per-batch source identity instead of mutating
source_nameacross loop iterations.Line 936’s browser-capture branch is gated by
source_name == "browser-capture", but Line 891/Line 943 mutatesource_nameto detected provider values. After the first file, later files in the same batch can bypass the dedicated browser-capture JSON path unintentionally.Suggested fix
- for path in paths: + watch_source_name = source_name + for path in paths: + detected_source_name = watch_source_name try: stat = path.stat() except OSError: failed.append(path) continue @@ if jsonl_like: provider, parse_as_session = _jsonl_provider_and_session_artifact(path, fallback_provider) - source_name = provider.value + detected_source_name = provider.value if not parse_as_session: - self._mark_excluded_cursor(path, stat, source_name=source_name) + self._mark_excluded_cursor(path, stat, source_name=detected_source_name) continue @@ - elif source_name == "browser-capture" and path.suffix.lower() == ".json": + elif watch_source_name == "browser-capture" and path.suffix.lower() == ".json": @@ provider = _detect_provider_from_raw_bytes(payload, path.name, fallback_provider) - source_name = provider.value + detected_source_name = provider.value if not _parse_payload_as_session_artifact(path, provider=provider, payload=payload): - self._mark_excluded_cursor(path, stat, source_name=source_name) + self._mark_excluded_cursor(path, stat, source_name=detected_source_name) continue @@ elif stat.st_size >= _STREAMING_FULL_INGEST_BYTES: provider = _detect_provider_from_path_sample(path, fallback_provider) - source_name = provider.value + detected_source_name = provider.value if not _parse_path_as_session_artifact(path, provider=provider): - self._mark_excluded_cursor(path, stat, source_name=source_name) + self._mark_excluded_cursor(path, stat, source_name=detected_source_name) continue @@ else: @@ provider = _detect_provider_from_raw_bytes(payload, path.name, fallback_provider) - source_name = provider.value + detected_source_name = provider.value if not _parse_payload_as_session_artifact(path, provider=provider, payload=payload): - self._mark_excluded_cursor(path, stat, source_name=source_name) + self._mark_excluded_cursor(path, stat, source_name=detected_source_name) continue @@ - raw_source_names[path] = source_name + raw_source_names[path] = detected_source_name @@ - source_name=source_name, + source_name=detected_source_name,Also applies to: 936-946, 1009-1014
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@polylogue/sources/live/batch.py` around lines 891 - 894, The issue is that source_name is being mutated at line 891 when assigned to provider.value, and this mutation persists across loop iterations, causing the conditional check at line 936 (if source_name == "browser-capture") to incorrectly bypass the dedicated browser-capture JSON path for subsequent files in the same batch. Instead of mutating source_name directly, use a separate local variable (e.g., detected_source_name or provider_source_name) to store provider.value and pass that to the _mark_excluded_cursor call, while preserving the original source_name variable for the conditional checks later in the loop.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@devtools/deployment_smoke.py`:
- Around line 397-409: The latest_relative variable is being used directly in
the latest_suffix_pattern for a SQL LIKE query without escaping special wildcard
characters. Filenames containing percent signs (%) or underscores (_) in
latest_relative will be interpreted as SQL wildcards instead of literal
characters, causing incorrect row matches. To fix this, escape the
latest_relative variable by replacing percent signs with backslash-escaped
percent signs and underscores with backslash-escaped underscores before
constructing the latest_suffix_pattern string. Additionally, add an ESCAPE '\'
clause to the WHERE condition's LIKE expression to tell SQL to treat backslash
as the escape character when evaluating the pattern.
- Around line 20-27: The SYSTEMWIDE_PATH variable contains hard-coded paths that
include the specific username sinity in the paths
/etc/profiles/per-user/sinity/bin, /home/sinity/.nix-profile/bin, and
/home/sinity/.local/bin, making the default behavior deployment and
user-specific. Remove these user-specific paths from the SYSTEMWIDE_PATH
definition or refactor the path construction to dynamically use the current
user's username instead of hard-coding sinity, so that the probe works correctly
across different deployments and users.
- Around line 488-507: The _latest_spooled_capture_summary function currently
only handles a top-level dict containing a session field, but the ingest path
now supports list-wrapped capture envelopes. After the JSON is parsed into the
raw variable, add logic to unwrap the list if raw is a list instead of a dict.
If raw is a list, extract the appropriate element (typically the last element
for a spooled capture) and use that as the actual capture envelope before
proceeding with the existing session extraction logic that checks
isinstance(raw, dict) and accesses raw.get("session").
In `@devtools/render_cli_output_schemas.py`:
- Around line 222-236: The _build_schema() function is generating an incorrect
"Generated from ..." module attribution for ActionAffordanceListPayload by
hardcoding polylogue.surfaces.payloads, when the model actually originates from
polylogue.operations.action_contracts. Update _build_schema() to derive the
module path from the model's actual __module__ attribute instead of using a
hardcoded value, ensuring the generated schema descriptions accurately reflect
where each model is defined.
In `@polylogue/daemon/status.py`:
- Around line 1707-1712: The issue is that browser_capture_active is determined
by checking effective_browser_capture_spool_path which is set to a default value
if None is passed, meaning the active flag can never be False when the intent
was to disable browser capture. To fix this, determine browser_capture_active by
checking the original browser_capture_spool_path parameter instead of the
effective_browser_capture_spool_path after the fallback. This allows passing
None to properly disable browser capture functionality that propagates to the
status checks at lines 1763 and 1832.
In `@polylogue/operations/action_contracts.py`:
- Around line 305-320: The `_validate_contracts()` function does not validate
that contract paths are non-empty, which causes issues since `action_id` is
derived from joining the path with dots. Add a validation check at the beginning
of the function (before or alongside the duplicate_paths check) to ensure each
entry in ACTION_CONTRACTS has a non-empty path, and raise a ValueError with a
descriptive message if any entry has an empty path.
In `@tests/unit/cli/test_completions_contract.py`:
- Around line 170-176: The assertion in
test_action_affordances_accepts_common_json_flags currently hard-codes the list
index assumption by checking payload["actions"][0]["id"] == "find", which
creates order-coupling and can break if actions are reordered in the future.
Instead of relying on index position, modify the assertion to search through the
actions list to find an action with id "find" (for example, using a loop or list
comprehension to assert that an action with id "find" exists in the
payload["actions"] list), making the test resilient to harmless reordering of
the actions.
In `@tests/unit/daemon/test_daemon_status.py`:
- Around line 183-200: The test
test_daemon_status_uses_default_browser_capture_spool mocks
BrowserCaptureReceiverConfig.default() with a specific spool_path value
(tmp_path / "browser-capture") but only verifies the active state and component
status, not the actual spool_path propagation. Add an assertion that verifies
the spool_path in the returned payload matches the mocked spool_path to ensure
the default configuration wiring is working correctly, not just that the
component is active.
In `@tests/unit/sources/test_live_batch_support.py`:
- Around line 412-419: The SQL query applying group_concat is non-deterministic
in SQLite versions before 3.44.0 because the ORDER BY clause is placed outside
the aggregate function rather than controlling the input order. Refactor the
query by creating an inner subquery that selects and orders the concatenated
role and text values by messages.position and blocks.position, then wrap that
subquery with an outer query that applies group_concat to the pre-ordered
results. This ensures the concatenation respects the specified order across all
supported SQLite versions.
---
Outside diff comments:
In `@polylogue/sources/live/batch.py`:
- Around line 891-894: The issue is that source_name is being mutated at line
891 when assigned to provider.value, and this mutation persists across loop
iterations, causing the conditional check at line 936 (if source_name ==
"browser-capture") to incorrectly bypass the dedicated browser-capture JSON path
for subsequent files in the same batch. Instead of mutating source_name
directly, use a separate local variable (e.g., detected_source_name or
provider_source_name) to store provider.value and pass that to the
_mark_excluded_cursor call, while preserving the original source_name variable
for the conditional checks later in the loop.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 92494d88-501d-4f58-99c5-057f626c8ec5
📒 Files selected for processing (95)
AGENTS.mdREADME.mdTESTING.mdbrowser-extension/README.mdbrowser-extension/manifest.jsonbrowser-extension/src/common.jsbrowser-extension/src/content/chatgpt.jsbrowser-extension/tests/common.test.jsdevtools/action_contract_report.pydevtools/command_catalog.pydevtools/deployment_smoke.pydevtools/docs_surface.pydevtools/render_cli_output_schemas.pydevtools/render_docs_surface.pydocs/README.mddocs/architecture-spine.mddocs/browser-capture.mddocs/cli-reference.mddocs/design/README.mddocs/design/query-action-workflows.mddocs/devtools.mddocs/internals.mddocs/openapi/search.yamldocs/plans/topology-target.yamldocs/repo-layout.mddocs/schemas/cli-output/README.mddocs/schemas/cli-output/action-affordance-list.schema.jsondocs/schemas/cli-output/search-envelope.schema.jsondocs/topology-status.mdflake.nixpolylogue/archive/query/completions.pypolylogue/browser_capture/models.pypolylogue/browser_capture/server.pypolylogue/cli/click_app.pypolylogue/cli/click_option_groups.pypolylogue/cli/commands/completions.pypolylogue/cli/commands/config.pypolylogue/cli/machine_main.pypolylogue/cli/parser_diagnostics.pypolylogue/cli/query_group.pypolylogue/cli/query_verbs.pypolylogue/daemon/cli.pypolylogue/daemon/http.pypolylogue/daemon/route_contracts.pypolylogue/daemon/status.pypolylogue/daemon/status_snapshot.pypolylogue/daemon/web_shell.pypolylogue/demo/verify.pypolylogue/demo/workspace.pypolylogue/mcp/server_tools.pypolylogue/operations/action_contracts.pypolylogue/scenarios/corpus.pypolylogue/schemas/synthetic/__init__.pypolylogue/schemas/synthetic/build_batch.pypolylogue/schemas/synthetic/build_records.pypolylogue/schemas/synthetic/build_wire_formats.pypolylogue/schemas/synthetic/core.pypolylogue/schemas/synthetic/demo_themes.pypolylogue/schemas/synthetic/models.pypolylogue/schemas/synthetic/semantic_values.pypolylogue/sources/dispatch.pypolylogue/sources/live/batch.pypolylogue/sources/live/batch_support.pypolylogue/sources/live/watcher.pypolylogue/sources/parsers/browser_capture.pypolylogue/surfaces/action_affordances.pypolylogue/surfaces/payloads.pytests/data/witnesses/cli-command-surface.jsontests/unit/browser_capture/test_receiver.pytests/unit/cli/__snapshots__/test_help_snapshots.ambrtests/unit/cli/__snapshots__/test_terminal_snapshots.ambrtests/unit/cli/test_cli_action_contracts.pytests/unit/cli/test_click_app.pytests/unit/cli/test_completions_contract.pytests/unit/cli/test_diagnose_and_error_discipline.pytests/unit/core/test_synthetic_semantics.pytests/unit/daemon/test_daemon_cli.pytests/unit/daemon/test_daemon_cli_remote_bind.pytests/unit/daemon/test_daemon_http_contracts.pytests/unit/daemon/test_daemon_status.pytests/unit/daemon/test_web_reader.pytests/unit/demo/test_workspace.pytests/unit/devtools/test_action_contract_report.pytests/unit/devtools/test_deployment_smoke.pytests/unit/insights/test_transforms.pytests/unit/mcp/test_envelope_contracts.pytests/unit/mcp/test_tool_contracts.pytests/unit/mcp/test_tool_discovery.pytests/unit/scenarios/test_corpus.pytests/unit/sources/test_browser_capture.pytests/unit/sources/test_live_batch_support.pytests/unit/sources/test_live_catchup_planning.pytests/unit/sources/test_live_watcher.pytests/unit/storage/test_no_string_interpolated_sql.pytests/unit/surfaces/test_search_envelope_contract.py
💤 Files with no reviewable changes (1)
- tests/data/witnesses/cli-command-surface.json
| effective_browser_capture_spool_path = ( | ||
| browser_capture_spool_path | ||
| if browser_capture_spool_path is not None | ||
| else BrowserCaptureReceiverConfig.default().spool_path | ||
| ) | ||
| browser_capture_active = effective_browser_capture_spool_path is not None |
There was a problem hiding this comment.
browser_capture_active is now effectively hard-coded to enabled.
Line 1707 falls back to BrowserCaptureReceiverConfig.default().spool_path, and Line 1712 checks only is not None; since the default spool path is always a Path, passing browser_capture_spool_path=None can no longer represent “disabled.” This incorrectly propagates to Line 1763 and Line 1832 as running/active.
💡 Suggested fix
- effective_browser_capture_spool_path = (
- browser_capture_spool_path
- if browser_capture_spool_path is not None
- else BrowserCaptureReceiverConfig.default().spool_path
- )
- browser_capture_active = effective_browser_capture_spool_path is not None
+ # Preserve explicit disabled semantics: None means browser capture is off.
+ # Callers that want default-on behavior should pass the default spool path explicitly.
+ effective_browser_capture_spool_path = browser_capture_spool_path
+ browser_capture_active = browser_capture_spool_path is not None🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@polylogue/daemon/status.py` around lines 1707 - 1712, The issue is that
browser_capture_active is determined by checking
effective_browser_capture_spool_path which is set to a default value if None is
passed, meaning the active flag can never be False when the intent was to
disable browser capture. To fix this, determine browser_capture_active by
checking the original browser_capture_spool_path parameter instead of the
effective_browser_capture_spool_path after the fallback. This allows passing
None to properly disable browser capture functionality that propagates to the
status checks at lines 1763 and 1832.
Problem: the select and browser-read query-action paths fed raw root query terms into the execution planner, so id:abc was treated as literal FTS text. On the live archive that broadened into expensive reads and a missing ID could surface as an unexpected KeyError. What changed: compile RootModeRequest through query_spec() before building selector filters, propagate session_id through archive execution kwargs, return empty rows/counts for missing session IDs, and replace session-id prefix LIKE scans with indexed range bounds. Verification: devtools test tests/unit/cli/test_select.py tests/unit/storage/test_session_id_resolution.py tests/unit/archive/test_archive_execution_filters.py; devtools verify --quick; live archive probes for id:abc no-match and a real id select.
Problem: browser-capture receiver artifacts are JSON snapshots, but the live batch append planner could treat larger replacements as incomplete append tails and then mark the new tail as deferred, causing the refreshed snapshot to be skipped. Review also found a host-specific smoke PATH and weak status/test assertions. What changed: browser-capture .json files now bypass append planning and return to the full-parse path on growth; receiver status exposes spool_path; deployment-smoke builds user paths dynamically; tests assert deterministic aggregation and status spool propagation. Verification: devtools test tests/unit/browser_capture/test_receiver.py tests/unit/daemon/test_daemon_status.py tests/unit/sources/test_live_batch_support.py tests/unit/devtools/test_deployment_smoke.py; devtools verify --quick.
2026-06-22 selector and review-followup probe\n\nFollow-up commits after the baseline-gate repair:\n\n-
|
Problem: the deployment smoke probe and related generated surfaces still had review-visible gaps: browser-capture suffix matching treated LIKE wildcards as pattern syntax, list-wrapped capture envelopes were ignored, schema provenance hard-coded one module, action contracts accepted empty paths, and status helpers inferred capture activity solely from a spool path. What changed: escape LIKE suffix probes, accept list-wrapped capture envelopes, render schema provenance from the actual model module, validate action-contract path shape, add an explicit browser_capture_enabled override to the status builder, and make the JSON flag assertion order-insensitive. Verification: devtools test tests/unit/devtools/test_deployment_smoke.py tests/unit/daemon/test_daemon_status.py tests/unit/cli/test_cli_action_contracts.py tests/unit/cli/test_completions_contract.py; devtools verify --quick
2026-06-22 review follow-up and deployed statePushed Review items handled:
Verification:
Live deploy through Sinnix override is now on
|
Problem: live deployment probing created implementable issues for query-action UX, web responsiveness, context packs, repo polish, and deployed-state trust, but docs/execution-plan.md still pointed future agents at the older substrate-only backlog map. What changed: add #2304-#2308 to the active backlog shape, sequence them against #2006/#1847/#1846, and add a rawlog coverage map so future work has one durable owner per theme instead of relying on chat context. Verification: devtools render docs-surface --check; devtools render all --check
Problem: after filing #2309 for runtime/deployment configuration policy, the execution plan still assigned configurability to general polish/dev-loop buckets. What changed: add #2309 to the active backlog table and execution order, and point the rawlog configurability row at that issue as the durable owner. Verification: devtools render docs-surface --check; devtools render all --check
2026-06-22 backlog alignment follow-upPushed two docs/backlog commits after the deployed smoke fixes:
Verification:
This does not change the deployed runtime; the live system remains on the previously switched |
2026-06-22 objective auditCurrent audit against the original live-probe/backlog objective:
Current live deployment evidence:
Remaining before declaring the thread fully closed: CodeRabbit is still reporting |
2026-06-22 final current smoke refreshBefore closing out the live-probe/backlog objective, I reran installed deployment smoke against the current systemwide deployment. Current non-browser smoke:
Current browser-render smoke:
All substantive GitHub checks are green. CodeRabbit still shows |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
polylogue/sources/live/batch.py (1)
936-955:⚠️ Potential issue | 🟠 Major | ⚡ Quick winUse a per-path source variable instead of mutating batch
source_name.Line 936 gates browser-capture JSON handling on
source_name == "browser-capture", butsource_nameis reassigned in-loop (e.g., Line 943). In multi-file batches, later browser-capture.jsonfiles can miss the special path and persist incorrect source provenance at Line 1009.💡 Proposed fix
- fallback_provider = Provider.from_string(canonical_acquisition_provider(source_name, source_name=source_name)) + batch_source_name = source_name + fallback_provider = Provider.from_string( + canonical_acquisition_provider(batch_source_name, source_name=batch_source_name) + ) @@ - for path in paths: + for path in paths: + path_source_name = batch_source_name @@ - elif source_name == "browser-capture" and path.suffix.lower() == ".json": + elif path_source_name == "browser-capture" and path.suffix.lower() == ".json": @@ - source_name = provider.value + path_source_name = provider.value @@ - raw_source_names[path] = source_name + raw_source_names[path] = path_source_name @@ - source_name=source_name, + source_name=path_source_name,Also applies to: 1009-1015
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@polylogue/sources/live/batch.py` around lines 936 - 955, The issue is that the variable source_name is being mutated inside the loop at line 943 (source_name = provider.value), which causes the condition at line 936 to fail for subsequent browser-capture JSON files in multi-file batches. Instead of reassigning the outer source_name variable, create a local variable to hold the detected source name and use that local variable in the subsequent calls like _mark_excluded_cursor and the heartbeat function, leaving the outer source_name unchanged so that the browser-capture condition check remains valid for all iterations in the loop.polylogue/daemon/status.py (1)
1848-1869:⚠️ Potential issue | 🟠 Major | ⚡ Quick winKeep nested
browser_capturestate consistent with the new override.
browser_capture_enabledis forwarded intobuild_daemon_status, but the nested"browser_capture"object is still generated independently frombrowser_capture_status_payload(...). Withbrowser_capture_enabled=False, this can return contradictory fields in one payload (browser_capture_active=Falsewhilebrowser_capture.active=True).💡 Proposed fix
def daemon_status_payload( @@ - return json_document( + browser_capture = dict(browser_capture_status_payload(browser_capture_spool_path)) + browser_capture["active"] = status.browser_capture_active + if not status.browser_capture_active: + browser_capture["spool_ready"] = False + + return json_document( { @@ - "browser_capture": browser_capture_status_payload(browser_capture_spool_path), + "browser_capture": browser_capture, @@ } )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@polylogue/daemon/status.py` around lines 1848 - 1869, The nested browser_capture state is generated independently without considering the browser_capture_enabled override parameter. Locate the call to browser_capture_status_payload(...) in this function and pass the browser_capture_enabled parameter to it, similar to how it's being passed to build_daemon_status(...). This ensures the nested browser_capture object respects the same override and maintains consistent state in the returned payload.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@polylogue/daemon/status.py`:
- Around line 1848-1869: The nested browser_capture state is generated
independently without considering the browser_capture_enabled override
parameter. Locate the call to browser_capture_status_payload(...) in this
function and pass the browser_capture_enabled parameter to it, similar to how
it's being passed to build_daemon_status(...). This ensures the nested
browser_capture object respects the same override and maintains consistent state
in the returned payload.
In `@polylogue/sources/live/batch.py`:
- Around line 936-955: The issue is that the variable source_name is being
mutated inside the loop at line 943 (source_name = provider.value), which causes
the condition at line 936 to fail for subsequent browser-capture JSON files in
multi-file batches. Instead of reassigning the outer source_name variable,
create a local variable to hold the detected source name and use that local
variable in the subsequent calls like _mark_excluded_cursor and the heartbeat
function, leaving the outer source_name unchanged so that the browser-capture
condition check remains valid for all iterations in the loop.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f0f62f43-cd6a-4621-935b-8dc927c26525
📒 Files selected for processing (23)
devtools/deployment_smoke.pydevtools/render_cli_output_schemas.pydocs/execution-plan.mddocs/schemas/cli-output/action-affordance-list.schema.jsonpolylogue/archive/query/archive_execution.pypolylogue/browser_capture/models.pypolylogue/browser_capture/receiver.pypolylogue/cli/read_views/standard.pypolylogue/cli/select.pypolylogue/daemon/status.pypolylogue/operations/action_contracts.pypolylogue/sources/live/batch.pypolylogue/storage/sqlite/archive_tiers/archive.pypolylogue/storage/sqlite/queries/sessions_identity.pytests/unit/archive/test_archive_execution_filters.pytests/unit/browser_capture/test_receiver.pytests/unit/cli/test_cli_action_contracts.pytests/unit/cli/test_completions_contract.pytests/unit/cli/test_select.pytests/unit/daemon/test_daemon_status.pytests/unit/devtools/test_deployment_smoke.pytests/unit/sources/test_live_batch_support.pytests/unit/storage/test_session_id_resolution.py
|
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
Turns live deployment probing into a concrete product/engineering slice: an installed-artifact deployment smoke command, deployed daemon/browser-capture fixes, query-action affordance contracts across CLI/HTTP/MCP/search envelopes, native ChatGPT browser-capture ingestion, repo hygiene cleanup, and durable backlog/design issues for the remaining UX and operations work.
Problem
Dogfooding against the restored ~20 GB archive showed that the deployed package could look superficially alive while core operator contracts were false or unprovable:
polylogued --versionwas missing and packaged query parsing lackedlark./api/read-view-profileswas absent in the locked deployment./api/healthcould trigger archive-scale readiness work.find QUERY then ACTIONbehavior lacked one durable interaction contract for target, safety, cardinality, destinations, confirmation, JSON envelopes, completions, and web/MCP affordances.Solution
Runtime and deployment trust:
devtools deployment-smoke/devtools workspace deployment-smoketo probe installed versions, shell completions, daemon routes, receiver routes, browser-capture spool/raw/index materialization, receiver archive-state, and optional Chrome DOM/screenshot evidence.polylogued --versionavailable and fixed package/runtime dependency closure./api/healthbounded to DB reachability instead of archive-scale readiness.Browser capture:
raw_sessions.origin.chatgpt-export:6a2ea930-87a8-83eb-adb7-4cf38ccaa6a3with 3,375 indexed messages.Query-action/product contract:
docs/design/query-action-workflows.mdfor thefind QUERY -> select/cardinality -> action -> render -> next actionsworkflow.CliActionContractinto typed shared action-affordance payloads and schemas.polylogue config action-affordances,GET /api/action-affordances, MCPaction_affordances, and ranked search envelopes.id:selector behavior forfind id:... then select --jsonso no-match/hit probes are bounded instead of broad FTS timeouts.Backlog/repo coherence:
showcase/command-witness naming in tracked source/docs where this branch touched it.docs/execution-plan.mdto include feat(web): make the workbench responsive under slow or missing routes #2304-feat(config): make runtime and deployment configuration intentional #2309 and a rawlog coverage map.Verification
Focused/local verification highlights:
devtools test tests/unit/devtools/test_deployment_smoke.py tests/unit/daemon/test_daemon_status.py tests/unit/cli/test_cli_action_contracts.py tests/unit/cli/test_completions_contract.py-> 95 passed.devtools test tests/unit/cli/test_select.py tests/unit/storage/test_session_id_resolution.py tests/unit/archive/test_archive_execution_filters.py-> 14 passed.devtools test tests/unit/browser_capture/test_receiver.py tests/unit/daemon/test_daemon_status.py tests/unit/sources/test_live_batch_support.py tests/unit/devtools/test_deployment_smoke.py-> 90 passed.devtools render docs-surface --checkanddevtools render all --checkpassed for the execution-plan updates.devtools verify --quickpassed repeatedly locally and in pre-push, including final HEAD111bf618e.devtools verifywas attempted on2a60879fb; static gates passed and pytest-testmon selected 4,334 tests, but pytest was externally SIGTERM'd after ~10 minutes at 28% with no failures reported (diagnosis=external_signal). I did not rerun that broad path after smaller follow-up commits.Live deployed evidence through Sinnix override:
1ec3d48from this PR branch:polylogue, version 0.1.0+1ec3d48andpolylogued, version 0.1.0+1ec3d48.polylogued.serviceactive/running,NRestarts=0; post-catch-up observed current memory ~420 MiB, later ~1.4 GiB, peak ~2.0 GiB under the user-service limits.devtools workspace deployment-smoke --json->ok=True,failures=[].devtools workspace deployment-smoke --browser --browser-executable /etc/profiles/per-user/sinity/bin/google-chrome --json->ok=True,failures=[], nonzero DOM and screenshot bytes.6a2ea930-87a8-83eb-adb7-4cf38ccaa6a3, 3,375 turns, 3,375 indexed messages, receiver archive-state HTTP 200.find id:abc then select --jsonexits 2 withNo sessions matched.within the timeout.find id:claude-code-session:971ddc00-0dea-4f67-9bac-d5756bdea57e then select --jsonreturns the expected JSON row within the timeout.GitHub checks are green except intentionally skipped release/test jobs as of the final check run before this body update; CodeRabbit was still finishing its last review pass.
Follow-up Owners
This PR deliberately does not try to finish every product feature it designed. Remaining work is tracked in durable issues:
Ref #1807
Ref #2248
Ref #2304
Ref #2305
Ref #2306
Ref #2307
Ref #2308
Ref #2309
Summary by CodeRabbit
New Features
workspace deployment-smoketo devtools and introduced a deployment smoke-test flow for probing installs./api/action-affordancesendpoint, plus matching CLI and MCP tooling.Bug Fixes / Improvements
Documentation
Tests