Skip to content

fix: harden CLI error contracts and machine envelopes - #183

Merged
Sinity merged 31 commits into
masterfrom
feature/fix/stack-02-cli-contracts
Apr 16, 2026
Merged

Sinity merged 31 commits into
masterfrom
feature/fix/stack-02-cli-contracts

Conversation

@Sinity

@Sinity Sinity commented Apr 16, 2026

Copy link
Copy Markdown
Owner

Summary

PR 2/9. Stacked on feature/chore/stack-01-governance.

First wave of CLI-surface fixes found during live vetting. Every plain-mode PolylogueError now renders as a Click user error rather than a raw traceback, and the machine envelope is consistent across every query verb.

Problem

Live vetting against a real archive exposed a cluster of user-facing regressions on the CLI query surface:

  • polylogue --plain stats --by provider --format json raised a full traceback ending in DatabaseError on stale schema, instead of a structured envelope.
  • polylogue --plain query --help advertised an option placement that the real parser rejected (Error: No such option: --provider).
  • polylogue stats --by provider silently dropped grouped mode because the positional stats verb forced stats_only=True.
  • polylogue stats --format json ignored the requested output format in the SQL-backed stats path.
  • polylogue --plain --similar "debug parser" list told users to run polylogue embed — an old command. Canonical is polylogue run embed.
  • polylogue --format json list -n 1 emitted plain early-failure behavior instead of a structured runtime envelope.
  • The pre-scan command extractor treated option payloads like json / 1 as command words, corrupting the machine envelope's command field.
  • polylogue stats --format json reported messages_total=137 while messages_user=0 and messages_assistant=0 — role counts were hardcoded to zero, and the filtered branch dropped its temp id table before the word-count query.
  • polylogue --format json list -n 10 showed malformed ChatGPT conversation ids like chatgpt:synthetic-55392 synthetic-55392 syn because synthetic tree generation left the top-level ChatGPT id field as schema-generated text.
  • open --print-path <conversation-id> failed with Got unexpected extra argument when given a direct provider:id.
  • polylogue stats --by provider --limit 10 required --limit before the verb because the stats verb relied on root for --limit.
  • polylogue --plain tags --format json failed with No such option: --format.
  • Terminal snapshot baselines and showcase CLI boundaries still referenced python -m polylogue rather than the public polylogue executable.

Solution

  • Harden the root CLI error boundary so plain and JSON machine-main render PolylogueError as Click user errors instead of tracebacks.
  • Correct the root help example so provider/date filters appear before the query verb where the parser actually accepts them.
  • Make stats_only false when --by is present; pass output_format through SQL-backed stats; emit structured JSON/YAML/CSV for archive-wide stats.
  • Update the similarity-error branches to point at polylogue run embed.
  • Harden machine-mode detection for root --format json across list, open, tags, products, schema, and query mode; harden the pre-scan command extractor.
  • Fix aggregate_message_stats to report real role counts and word counts.
  • Assign clean UUIDs and stable timestamps to synthetic ChatGPT conversations.
  • Route a single trailing provider:id token in open through the exact conv_id filter.
  • Give stats a local --limit/-n option and forward it into the shared query params.
  • Accept --format json on tags in addition to --json.
  • Add archive-backed zsh completions for conversation IDs (with provider/title descriptions), open <target>, --tag/--exclude-tag, --tool/--exclude-tool, comma-aware provider completion.
  • Switch showcase CLI verification to the public polylogue executable and refresh the full help baseline.
  • Refresh terminal snapshot baselines and invalid option snapshot.

Verification

  • pytest -q --ignore=tests/integration
  • pytest -q tests/unit/cli/test_click_app.py tests/unit/cli/test_machine_main.py tests/unit/cli/test_machine_contract.py tests/unit/cli/test_query_exec_laws.py tests/unit/cli/test_query_exec.py tests/unit/cli/test_products.py tests/unit/cli/test_check.py tests/integration/test_cli_query_mode.py tests/integration/test_cli_tags_surface.py
  • ruff check polylogue tests devtools
  • Manual live probes: polylogue --format json list -n 1, polylogue --plain stats --by provider --format json, polylogue --plain open --print-path claude-code:<id>, polylogue --plain tags --format json.

Commits on this branch: 30 (delta against feature/chore/stack-01-governance).

Stack

Base: feature/chore/stack-01-governance. Next: feature/fix/stack-03-runtime-repair.

Sinity added 30 commits April 16, 2026 02:21
@coderabbitai

coderabbitai Bot commented Apr 16, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 57 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 2 minutes and 57 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 41eec941-c9b9-4f7e-af62-625cd33030cc

📥 Commits

Reviewing files that changed from the base of the PR and between a981356 and f4a681e.

📒 Files selected for processing (117)
  • .envrc
  • .gitignore
  • .local/README.md
  • devtools/build_package.py
  • devtools/command_catalog.py
  • devtools/project_motd.py
  • devtools/render_docs_surface.py
  • devtools/validation_lane_catalog_contracts.py
  • docs/README.md
  • docs/cli-reference.md
  • docs/configuration.md
  • docs/devtools.md
  • flake.nix
  • hatch_build.py
  • polylogue/cli/check_options.py
  • polylogue/cli/check_workflow.py
  • polylogue/cli/click_app.py
  • polylogue/cli/commands/check.py
  • polylogue/cli/commands/generate.py
  • polylogue/cli/commands/products.py
  • polylogue/cli/commands/qa.py
  • polylogue/cli/helper_summary.py
  • polylogue/cli/helpers.py
  • polylogue/cli/machine_errors.py
  • polylogue/cli/machine_main.py
  • polylogue/cli/query.py
  • polylogue/cli/query_output.py
  • polylogue/cli/query_stats.py
  • polylogue/cli/query_verbs.py
  • polylogue/cli/schema_rendering_explain.py
  • polylogue/cli/schema_rendering_results.py
  • polylogue/health.py
  • polylogue/paths_config.py
  • polylogue/schemas/audit_models.py
  • polylogue/schemas/audit_workflow.py
  • polylogue/schemas/operator_annotations.py
  • polylogue/schemas/synthetic/build_records.py
  • polylogue/showcase/cli_boundary.py
  • polylogue/showcase/exercise_catalog.json
  • polylogue/showcase/generators.py
  • polylogue/showcase/qa_runner_models.py
  • polylogue/showcase/qa_runner_workflow.py
  • polylogue/showcase/qa_session_payload.py
  • polylogue/storage/artifact_inspection.py
  • polylogue/storage/backends/queries/stats.py
  • polylogue/storage/embedding_stats.py
  • polylogue/version.py
  • tests/baselines/showcase/help-audit-generate.txt
  • tests/baselines/showcase/help-audit.txt
  • tests/baselines/showcase/help-auth.txt
  • tests/baselines/showcase/help-completions.txt
  • tests/baselines/showcase/help-count.txt
  • tests/baselines/showcase/help-dashboard.txt
  • tests/baselines/showcase/help-delete.txt
  • tests/baselines/showcase/help-doctor.txt
  • tests/baselines/showcase/help-list.txt
  • tests/baselines/showcase/help-main.txt
  • tests/baselines/showcase/help-mcp.txt
  • tests/baselines/showcase/help-open.txt
  • tests/baselines/showcase/help-products-analytics.txt
  • tests/baselines/showcase/help-products-day-summaries.txt
  • tests/baselines/showcase/help-products-enrichments.txt
  • tests/baselines/showcase/help-products-phases.txt
  • tests/baselines/showcase/help-products-profiles.txt
  • tests/baselines/showcase/help-products-tags.txt
  • tests/baselines/showcase/help-products-threads.txt
  • tests/baselines/showcase/help-products-week-summaries.txt
  • tests/baselines/showcase/help-products-work-events.txt
  • tests/baselines/showcase/help-products.txt
  • tests/baselines/showcase/help-reset.txt
  • tests/baselines/showcase/help-run-acquire.txt
  • tests/baselines/showcase/help-run-all.txt
  • tests/baselines/showcase/help-run-embed.txt
  • tests/baselines/showcase/help-run-index.txt
  • tests/baselines/showcase/help-run-materialize.txt
  • tests/baselines/showcase/help-run-parse.txt
  • tests/baselines/showcase/help-run-render.txt
  • tests/baselines/showcase/help-run-reprocess.txt
  • tests/baselines/showcase/help-run-schema.txt
  • tests/baselines/showcase/help-run-site.txt
  • tests/baselines/showcase/help-run.txt
  • tests/baselines/showcase/help-schema-audit.txt
  • tests/baselines/showcase/help-schema-compare.txt
  • tests/baselines/showcase/help-schema-explain.txt
  • tests/baselines/showcase/help-schema-generate.txt
  • tests/baselines/showcase/help-schema-list.txt
  • tests/baselines/showcase/help-schema-promote.txt
  • tests/baselines/showcase/help-schema.txt
  • tests/baselines/showcase/help-stats.txt
  • tests/baselines/showcase/help-tags.txt
  • tests/integration/test_cli_query_mode.py
  • tests/integration/test_schema_operator_workflow.py
  • tests/unit/cli/__snapshots__/test_terminal_snapshots.ambr
  • tests/unit/cli/test_click_app.py
  • tests/unit/cli/test_deterministic_output.py
  • tests/unit/cli/test_machine_contract.py
  • tests/unit/cli/test_machine_main.py
  • tests/unit/cli/test_products.py
  • tests/unit/cli/test_query_exec.py
  • tests/unit/cli/test_query_exec_laws.py
  • tests/unit/cli/test_source_selection_helpers.py
  • tests/unit/core/test_audit.py
  • tests/unit/core/test_config.py
  • tests/unit/core/test_health_core.py
  • tests/unit/core/test_operator_annotations.py
  • tests/unit/core/test_synthetic_semantics.py
  • tests/unit/core/test_verification.py
  • tests/unit/core/test_version.py
  • tests/unit/devtools/test_project_motd.py
  • tests/unit/devtools/test_render_docs_surface.py
  • tests/unit/showcase/test_cli_boundary.py
  • tests/unit/showcase/test_exercise_catalog.py
  • tests/unit/showcase/test_qa_runner.py
  • tests/unit/storage/test_embedding_stats.py
  • tests/unit/storage/test_fts5.py
  • tests/unit/storage/test_store_ops.py
  • tests/unit/storage/test_vec.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/stack-02-cli-contracts

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Ruff drift surfaced on polylogue/storage/backends/queries/stats.py,
tests/integration/test_cli_query_mode.py, and tests/unit/cli/test_click_app.py
after the rebase onto master. Also refresh the terminal snapshot and
showcase baselines for the `--format json` addition to product subcommands.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@Sinity
Sinity force-pushed the feature/fix/stack-02-cli-contracts branch from a19f24b to f4a681e Compare April 16, 2026 00:37
@Sinity
Sinity merged commit 817fcfd into master Apr 16, 2026
12 checks passed
@Sinity
Sinity deleted the feature/fix/stack-02-cli-contracts branch April 16, 2026 00:55
Sinity added a commit that referenced this pull request Apr 22, 2026
## Summary

PR 2/9. Stacked on `feature/chore/stack-01-governance`.

First wave of CLI-surface fixes found during live vetting. Every plain-mode `PolylogueError` now renders as a Click user error rather than a raw traceback, and the machine envelope is consistent across every query verb.

## Problem

Live vetting against a real archive exposed a cluster of user-facing regressions on the CLI query surface:

- `polylogue --plain stats --by provider --format json` raised a full traceback ending in `DatabaseError` on stale schema, instead of a structured envelope.
- `polylogue --plain query --help` advertised an option placement that the real parser rejected (`Error: No such option: --provider`).
- `polylogue stats --by provider` silently dropped grouped mode because the positional `stats` verb forced `stats_only=True`.
- `polylogue stats --format json` ignored the requested output format in the SQL-backed stats path.
- `polylogue --plain --similar "debug parser" list` told users to run `polylogue embed` — an old command. Canonical is `polylogue run embed`.
- `polylogue --format json list -n 1` emitted plain early-failure behavior instead of a structured runtime envelope.
- The pre-scan command extractor treated option payloads like `json` / `1` as command words, corrupting the machine envelope's `command` field.
- `polylogue stats --format json` reported `messages_total=137` while `messages_user=0` and `messages_assistant=0` — role counts were hardcoded to zero, and the filtered branch dropped its temp id table before the word-count query.
- `polylogue --format json list -n 10` showed malformed ChatGPT conversation ids like `chatgpt:synthetic-55392 synthetic-55392 syn` because synthetic tree generation left the top-level ChatGPT `id` field as schema-generated text.
- `open --print-path <conversation-id>` failed with `Got unexpected extra argument` when given a direct `provider:id`.
- `polylogue stats --by provider --limit 10` required `--limit` before the verb because the `stats` verb relied on root for `--limit`.
- `polylogue --plain tags --format json` failed with `No such option: --format`.
- Terminal snapshot baselines and showcase CLI boundaries still referenced `python -m polylogue` rather than the public `polylogue` executable.

## Solution

- Harden the root CLI error boundary so plain and JSON machine-main render `PolylogueError` as Click user errors instead of tracebacks.
- Correct the root help example so provider/date filters appear before the query verb where the parser actually accepts them.
- Make `stats_only` false when `--by` is present; pass `output_format` through SQL-backed stats; emit structured JSON/YAML/CSV for archive-wide stats.
- Update the similarity-error branches to point at `polylogue run embed`.
- Harden machine-mode detection for root `--format json` across `list`, `open`, `tags`, `products`, `schema`, and query mode; harden the pre-scan command extractor.
- Fix `aggregate_message_stats` to report real role counts and word counts.
- Assign clean UUIDs and stable timestamps to synthetic ChatGPT conversations.
- Route a single trailing `provider:id` token in `open` through the exact `conv_id` filter.
- Give `stats` a local `--limit/-n` option and forward it into the shared query params.
- Accept `--format json` on `tags` in addition to `--json`.
- Add archive-backed zsh completions for conversation IDs (with provider/title descriptions), `open <target>`, `--tag`/`--exclude-tag`, `--tool`/`--exclude-tool`, comma-aware provider completion.
- Switch showcase CLI verification to the public `polylogue` executable and refresh the full help baseline.
- Refresh terminal snapshot baselines and `invalid option` snapshot.

## Verification

- `pytest -q --ignore=tests/integration`
- `pytest -q tests/unit/cli/test_click_app.py tests/unit/cli/test_machine_main.py tests/unit/cli/test_machine_contract.py tests/unit/cli/test_query_exec_laws.py tests/unit/cli/test_query_exec.py tests/unit/cli/test_products.py tests/unit/cli/test_check.py tests/integration/test_cli_query_mode.py tests/integration/test_cli_tags_surface.py`
- `ruff check polylogue tests devtools`
- Manual live probes: `polylogue --format json list -n 1`, `polylogue --plain stats --by provider --format json`, `polylogue --plain open --print-path claude-code:<id>`, `polylogue --plain tags --format json`.

Commits on this branch: 30 (delta against `feature/chore/stack-01-governance`).

## Stack

Base: `feature/chore/stack-01-governance`. Next: `feature/fix/stack-03-runtime-repair`.
Sinity added a commit that referenced this pull request Apr 22, 2026
… unification (#186)

## Summary

Combined arc covering the remainder of the `feature/chore/repo-cleanup-governance` branch work. Arcs 1–3 landed in PRs #174, #183, #184. This PR covers arcs 4–9:

- **Perf** (arc 4): materialize rebuild bounds, single-record inline ingest, worker throttling, session refresh by message volume, default doctor probe slimming, JSONL lone-surrogate tolerance, malformed-line reporting, reparse preview/scope safety, acquisition heartbeats, site progress.
- **Artifact graph + storage bootstrap** (arc 5): shared action-event and raw-ingest artifact semantics, explicit artifact graph, unified schema bootstrap.
- **Scenario substrate wave 1** (arc 6): ScenarioMetadata, OperationSpec, typed QA requests, catalog extractions, runtime coverage maps.
- **Scenario execution + corpus roots** (arc 7): CorpusSpec as single input, ExecutionSpec unification, showcase exercise collapse, runtime path modeling, memory-budget lane compilation.
- **Final unification** (arc 8): AssertionSpec, ValidationLaneFamily, CorpusProfile, MaintenanceTargetSpec, CliSurfaceFamily, SQLite runtime collapse.
- **Runtime fixes** (arc 9): parse-vs-validation failure split, action-event orphan readiness, verifier decode-error preservation.

## Problem

The 244-commit branch introduced tightly-coupled architectural unifications across scenario, verification, storage, and runtime surfaces. Splitting these into 6 independently-functional PRs proved impractical — cherry-picking individual arcs onto an intermediate master created semantic drift that broke test consistency.

## Solution

Cherry-pick the remaining 161 commits (positions 84–244 of the original branch) onto the current master (which already has arcs 1–3 merged). Three conflicts resolved during cherry-pick: CLAUDE.md transclusion paths (`.claude/` → `.agent/`), `async_sqlite_schema.py` (format drift), `schema_upgrade.py` (deletion accepted). Followed by a ruff format pass, snapshot refresh, showcase baseline update, and xfail removal.

## Verification

- `pytest -q --ignore=tests/integration` → 4881 passed (7 test-isolation artifacts pass individually)
- `ruff check polylogue/ tests/ devtools/` → all checks passed
- `ruff format --check polylogue/ tests/ devtools/` → all formatted
- `devtools verify-showcase --update` → 43 exercises, baselines current
- `pytest tests/unit/cli/test_terminal_snapshots.py --snapshot-update` → 10 passed
Sinity added a commit that referenced this pull request Apr 22, 2026
Live vetting against a real archive exposed a cluster of user-facing
CLI regressions: raw tracebacks leaking through plain mode, help
text advertising flag positions the parser rejected, `stats`
silently dropping grouped mode, role counts hardcoded to zero,
synthetic ChatGPT conversation ids malformed, and the machine
envelope's `command` field corrupted by option payloads.

Root fixes rather than per-symptom patches. The root CLI error
boundary now renders `PolylogueError` as Click user errors across
plain and JSON machine-main — no more raw stack traces. Machine-mode
detection hardens across `list`, `open`, `tags`, `products`,
`schema`, and query verbs; the pre-scan command extractor no longer
treats option values as command words. `stats` grows a local
`--limit` option so it stops relying on the root verb, and
`aggregate_message_stats` reports real role and word counts instead
of zeros. Help text and similarity-error hints point at the actual
commands (`polylogue run embed`, not the old `polylogue embed`).

Adds archive-backed zsh completions for conversation ids (with
provider/title descriptions), `open <target>`, tag/tool filters, and
comma-aware provider completion. Showcase CLI verification switches
to the public `polylogue` executable; terminal snapshot baselines
refresh to match.

Verification: pytest over unit CLI contracts plus integration
cli_query_mode / cli_tags_surface suites, ruff clean, and live manual
probes against the default archive root.
Sinity added a commit that referenced this pull request Apr 22, 2026
… unification (#186)

Completes the `feature/chore/repo-cleanup-governance` architectural
wave, landing arcs 4-9 of the 244-commit branch (arcs 1-3 merged as
PRs #174 / #183 / #184). Splitting the remaining 161 commits into
independently-functional PRs proved impractical — the arcs are
cross-coupled enough that cherry-picking individual ones onto
intermediate master produced semantic drift that broke test
consistency. Merged as one coherent step.

Arc 4 (perf): materialize rebuild bounds, single-record inline
ingest, worker throttling, session refresh keyed to message volume,
default doctor probe slimming, JSONL lone-surrogate tolerance,
malformed-line reporting, reparse preview/scope safety, acquisition
heartbeats, site progress reporting.

Arc 5 (artifact graph + storage bootstrap): shared action-event and
raw-ingest artifact semantics, explicit artifact graph, unified
schema bootstrap.

Arc 6 (scenario substrate wave 1): `ScenarioMetadata`,
`OperationSpec`, typed QA requests, catalog extractions, runtime
coverage maps.

Arc 7 (scenario execution + corpus roots): `CorpusSpec` as single
input, `ExecutionSpec` unification, showcase exercise collapse,
runtime path modeling, memory-budget lane compilation.

Arc 8 (final unification): `AssertionSpec`, `ValidationLaneFamily`,
`CorpusProfile`, `MaintenanceTargetSpec`, `CliSurfaceFamily`,
SQLite runtime collapse.

Arc 9 (runtime fixes): parse-vs-validation failure split,
action-event orphan readiness, verifier decode-error preservation.

Three conflicts during cherry-pick: CLAUDE.md transclusion paths
(`.claude/` → `.agent/`), `async_sqlite_schema.py` format drift,
`schema_upgrade.py` deletion accepted. Followed by ruff format pass,
snapshot refresh, showcase baseline update, xfail removal.

Verification: 4881 pytest (ignoring integration), ruff clean,
showcase baselines current across 43 exercises, terminal snapshot
baselines refreshed.
Sinity added a commit that referenced this pull request Apr 22, 2026
Live vetting against a real archive exposed a cluster of user-facing
CLI regressions: raw tracebacks leaking through plain mode, help
text advertising flag positions the parser rejected, `stats`
silently dropping grouped mode, role counts hardcoded to zero,
synthetic ChatGPT conversation ids malformed, and the machine
envelope's `command` field corrupted by option payloads.

Root fixes rather than per-symptom patches. The root CLI error
boundary now renders `PolylogueError` as Click user errors across
plain and JSON machine-main — no more raw stack traces. Machine-mode
detection hardens across `list`, `open`, `tags`, `products`,
`schema`, and query verbs; the pre-scan command extractor no longer
treats option values as command words. `stats` grows a local
`--limit` option so it stops relying on the root verb, and
`aggregate_message_stats` reports real role and word counts instead
of zeros. Help text and similarity-error hints point at the actual
commands (`polylogue run embed`, not the old `polylogue embed`).

Adds archive-backed zsh completions for conversation ids (with
provider/title descriptions), `open <target>`, tag/tool filters, and
comma-aware provider completion. Showcase CLI verification switches
to the public `polylogue` executable; terminal snapshot baselines
refresh to match.

Verification: pytest over unit CLI contracts plus integration
cli_query_mode / cli_tags_surface suites, ruff clean, and live manual
probes against the default archive root.
Sinity added a commit that referenced this pull request Apr 22, 2026
… unification (#186)

Completes the `feature/chore/repo-cleanup-governance` architectural
wave, landing arcs 4-9 of the 244-commit branch (arcs 1-3 merged as
PRs #174 / #183 / #184). Splitting the remaining 161 commits into
independently-functional PRs proved impractical — the arcs are
cross-coupled enough that cherry-picking individual ones onto
intermediate master produced semantic drift that broke test
consistency. Merged as one coherent step.

Arc 4 (perf): materialize rebuild bounds, single-record inline
ingest, worker throttling, session refresh keyed to message volume,
default doctor probe slimming, JSONL lone-surrogate tolerance,
malformed-line reporting, reparse preview/scope safety, acquisition
heartbeats, site progress reporting.

Arc 5 (artifact graph + storage bootstrap): shared action-event and
raw-ingest artifact semantics, explicit artifact graph, unified
schema bootstrap.

Arc 6 (scenario substrate wave 1): `ScenarioMetadata`,
`OperationSpec`, typed QA requests, catalog extractions, runtime
coverage maps.

Arc 7 (scenario execution + corpus roots): `CorpusSpec` as single
input, `ExecutionSpec` unification, showcase exercise collapse,
runtime path modeling, memory-budget lane compilation.

Arc 8 (final unification): `AssertionSpec`, `ValidationLaneFamily`,
`CorpusProfile`, `MaintenanceTargetSpec`, `CliSurfaceFamily`,
SQLite runtime collapse.

Arc 9 (runtime fixes): parse-vs-validation failure split,
action-event orphan readiness, verifier decode-error preservation.

Three conflicts during cherry-pick: CLAUDE.md transclusion paths
(`.claude/` → `.agent/`), `async_sqlite_schema.py` format drift,
`schema_upgrade.py` deletion accepted. Followed by ruff format pass,
snapshot refresh, showcase baseline update, xfail removal.

Verification: 4881 pytest (ignoring integration), ruff clean,
showcase baselines current across 43 exercises, terminal snapshot
baselines refreshed.
Sinity added a commit that referenced this pull request Apr 22, 2026
Live vetting against a real archive exposed a cluster of user-facing
CLI regressions: raw tracebacks leaking through plain mode, help
text advertising flag positions the parser rejected, `stats`
silently dropping grouped mode, role counts hardcoded to zero,
synthetic ChatGPT conversation ids malformed, and the machine
envelope's `command` field corrupted by option payloads.

Root fixes rather than per-symptom patches. The root CLI error
boundary now renders `PolylogueError` as Click user errors across
plain and JSON machine-main — no more raw stack traces. Machine-mode
detection hardens across `list`, `open`, `tags`, `products`,
`schema`, and query verbs; the pre-scan command extractor no longer
treats option values as command words. `stats` grows a local
`--limit` option so it stops relying on the root verb, and
`aggregate_message_stats` reports real role and word counts instead
of zeros. Help text and similarity-error hints point at the actual
commands (`polylogue run embed`, not the old `polylogue embed`).

Adds archive-backed zsh completions for conversation ids (with
provider/title descriptions), `open <target>`, tag/tool filters, and
comma-aware provider completion. Showcase CLI verification switches
to the public `polylogue` executable; terminal snapshot baselines
refresh to match.

Verification: pytest over unit CLI contracts plus integration
cli_query_mode / cli_tags_surface suites, ruff clean, and live manual
probes against the default archive root.
Sinity added a commit that referenced this pull request Apr 22, 2026
… unification (#186)

Completes the `feature/chore/repo-cleanup-governance` architectural
wave, landing arcs 4-9 of the 244-commit branch (arcs 1-3 merged as
PRs #174 / #183 / #184). Splitting the remaining 161 commits into
independently-functional PRs proved impractical — the arcs are
cross-coupled enough that cherry-picking individual ones onto
intermediate master produced semantic drift that broke test
consistency. Merged as one coherent step.

Arc 4 (perf): materialize rebuild bounds, single-record inline
ingest, worker throttling, session refresh keyed to message volume,
default doctor probe slimming, JSONL lone-surrogate tolerance,
malformed-line reporting, reparse preview/scope safety, acquisition
heartbeats, site progress reporting.

Arc 5 (artifact graph + storage bootstrap): shared action-event and
raw-ingest artifact semantics, explicit artifact graph, unified
schema bootstrap.

Arc 6 (scenario substrate wave 1): `ScenarioMetadata`,
`OperationSpec`, typed QA requests, catalog extractions, runtime
coverage maps.

Arc 7 (scenario execution + corpus roots): `CorpusSpec` as single
input, `ExecutionSpec` unification, showcase exercise collapse,
runtime path modeling, memory-budget lane compilation.

Arc 8 (final unification): `AssertionSpec`, `ValidationLaneFamily`,
`CorpusProfile`, `MaintenanceTargetSpec`, `CliSurfaceFamily`,
SQLite runtime collapse.

Arc 9 (runtime fixes): parse-vs-validation failure split,
action-event orphan readiness, verifier decode-error preservation.

Three conflicts during cherry-pick: CLAUDE.md transclusion paths
(`.claude/` → `.agent/`), `async_sqlite_schema.py` format drift,
`schema_upgrade.py` deletion accepted. Followed by ruff format pass,
snapshot refresh, showcase baseline update, xfail removal.

Verification: 4881 pytest (ignoring integration), ruff clean,
showcase baselines current across 43 exercises, terminal snapshot
baselines refreshed.
@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 817fcfddc6

ℹ️ 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/version.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.

  • 77.F070 / P2: fixed-already at the checked revision: HEAD resolution searches both the worktree git directory and its resolved commondir, then checks packed refs in the common directory; linked branch worktrees retain commit metadata. See polylogue/version.py:110.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant