Skip to content

fix: aggregate small fixes from adversarial audit (waves 1+2) #488

Closed

Description

@Sinity

Small-scope fixes aggregated from adversarial audit

Each item is a 1-15 line change with minimal blast radius. Grouped by module.

Parsers (2 items)

Hashing (1 item)

Storage/DB (6 items)

Config/paths (3 items)

  • privacy_config.py:138-140 — replace duplicate _xdg_config_home() with import from polylogue.paths
  • config.py:68,75 — remove dead fts_enabled field
  • privacy.py:219 — fix max_length or _SAFE_ENUM_MAX_LEN → max_length if max_length is not None else _SAFE_ENUM_MAX_LEN

Logging/output (3 items)

  • logging.py:148 — respect POLYLOGUE_FORCE_PLAIN for structlog colors
  • rendering/core_markdown.py:55-57 — escape # and ### headings, not just ##
  • rendering/formatting.py:142-159 — prefix CSV cells starting with =, +, -, @ with ' to prevent injection

CLI (5 items)

  • query_verbs.py:76-86 — fix open_verb to concatenate parent + target terms like show_verb [ref fix(cli): open_verb fails provider:id routing + UX polish #471]
  • query_verbs.py:89-107 — fix show_verb help text ("default streaming output" → "full-content output")
  • commands/export.py:43 — document provider:id format in help text
  • query_verbs.py:112-116 — route bulk-export through tail-wrapping logic for --tail support
  • helper_summary.py — add onboarding hint when archive is empty

MCP (3 items)

  • server_support.py:81-94 — add upper bound to _clamp_limit (e.g., min(limit, 1000))
  • server_tools.py:214 — use Literal["provider", "month", "year"] for group_by
  • conversations_identity.py:15-31 — add strict=True flag for destructive operations, require exact ID match for delete

Build/packaging (3 items)

  • flake.nix:57 — add h2 dependency for httpx[http2] support
  • hatch_build.py:61-62 — fix finalize() to not break sdist builds
  • Replace typing_extensions imports with stdlib typing (Python >=3.11)

Dead code removal (2 items)

  • Delete cli/commands/embed.py (orphaned module, only imported by tests)
  • Update tests/unit/cli/test_embed.py to import from embed_runtime/embed_stats directly

Pricing/products (2 items)

  • pricing.py:194-210 — sort PRICING dict keys by length descending for model name prefix matching
  • archive_products.py:429-435 — add timezone awareness to profile_bucket_day()

Minor security hardening (2 items)

  • site/publication_flow.py:215 — strip absolute output_dir from manifest
  • blob_store.py:88, connection.py:89 — add os.chmod(0o600) on db and blob files

Documentation (1 item)

  • cli/commands/check.py:31 — rename doctor command or add check/health aliases for discoverability

Discovered during adversarial audit 2026-04-26.

Activity

  1. added a commit that references this issue on Apr 26, 2026
    34cb2c5
  2. added a commit that references this issue on May 7, 2026
    ddf212f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions