Skip to content

refactor(verifiability): streamline xtask test patterns without losing affected-test evidence #1981

Description

@Sinity

Purpose

The Polylogue/Sinex verifiability chatlog at /realm/inbox/download/6a35bffd-84fc-83eb-aeb5-74592f8cbcfb.md mostly developed concrete Polylogue scope, but it also identified a smaller Sinex-specific direction: keep Sinex's affected-test/impact architecture, and streamline duplicated test patterns without weakening nextest/impact observability.

This issue is intentionally narrower than the Polylogue sister issue. It should not become a rewrite of xtask, the impact planner, or nextest orchestration.

Related Polylogue sister issue: Sinity/polylogue#2196

Current diagnosis from the chatlog

Sinex's verification spine is already comparatively coherent:

  • xtask is the conductor command.
  • nextest gives named Rust test execution and useful profiles.
  • The impact planner and proof/evidence history are valuable for agent-default affected runs.
  • The default optimized path should stay useful for agents; do not make affected selection opt-in by default.

The risk is not the architecture. The risk is duplicated test implementation and incomplete gate visibility around a few known domains.

Scope

1. Preserve affected-test observability while compressing test code

When compressing Rust test families, do not collapse all behavior into one opaque test. Preserve per-case names through macros, rstest, generated named tests, or explicit case ids so nextest and the impact planner can still report meaningful failures.

Rule:

compress implementation, not observability

2. Required-input-key source tests

The chatlog identified repeated required-input-key tests across source families, including paths like:

crate/sinexd/tests/sources/activitywatch_required_input_keys_test.rs
crate/sinexd/tests/sources/conversation_required_input_keys_test.rs
crate/sinexd/tests/sources/json_array_required_input_keys_test.rs
crate/sinexd/tests/sources/jsonl_required_input_keys_test.rs
crate/sinexd/tests/sources/static_csv_required_input_keys_test.rs
crate/sinexd/tests/sources/system_required_input_keys_test.rs
crate/sinexd/tests/sources/terminal_required_input_keys_test.rs

Target: a shared matrix or macro that expands to named tests per source family and required-key case. Keep family-specific exceptions explicit rather than hiding them inside generic code.

3. Production-path source tests

The chatlog called out crate/sinexd/tests/sources/production_path.rs and wrappers under paths such as:

crate/sinexd/tests/sources/production_path/browser.rs
crate/sinexd/tests/sources/production_path/terminal.rs
crate/sinexd/tests/sources/production_path/desktop.rs
crate/sinexd/tests/sources/production_path/social_exports.rs
crate/sinexd/tests/sources/production_path/export_parsers.rs
crate/sinexd/tests/sources/production_path/system.rs

Target: a shared production-path case catalog where the common source-path law is tested once per named case. Keep genuine parser-specific direct assertions separate when they would make the generic harness muddy.

4. Fixture helpers

The chatlog saw likely overlap between append-only and static-file fixtures, e.g.:

crate/sinexd/tests/sources/production_path/fixtures/append_only_file.rs
crate/sinexd/tests/sources/production_path/fixtures/static_file.rs

Target: factor shared fixture setup without erasing the semantic distinction between append-only and static material.

5. Replay, chaos, and summarizer harnesses

The chatlog suggested a shared harness shape for repeated replay/chaos/summarizer patterns, including examples such as:

tests/vm-suite/src/categories/chaos_network_partition.rs
tests/vm-suite/src/categories/chaos_process_restart.rs
crate/sinexd/tests/api/replay_determinism_test.rs
crate/sinexd/tests/api/replay_rpc_live_test.rs
crate/sinexd/tests/automata/daily_summarizer_test.rs
crate/sinexd/tests/automata/hourly_summarizer_test.rs

Target: extract common setup/assertion helpers where the same replay or summarizer law is repeated. Do not hide operationally different chaos cases behind an over-general abstraction.

6. Compile-fail tests

For trybuild-style tests under paths like:

crate/sinex-primitives/tests/source_contract_compile_fail/*.rs
crate/sinex-macros/tests/compile_fail/*.rs

Keep individual fixture files. Compress the runner, not the diagnostic fixtures, because per-file expected diagnostics are valuable.

7. Gate visibility and cadence

The chatlog's concrete gate concerns were:

  • PR-visible cheap gates should expose changed-strict/impact evidence, generated docs/schema checks, and impact explain output where feasible.
  • Full or audit-heavy checks should remain explicit, scheduled, or master-only if too expensive for every PR.
  • Privacy enforcement tests still need to prove behavior across destinations, not only catalog loading.
  • Known residual correctness work around replay/archive invalidation belongs to its own runtime-hardening issue, not this cleanup issue.

Potential commands to evaluate for PR or scheduled cadence:

xtask check --changed-strict <base-ref>
xtask docs command-reference --check
xtask docs schema-bundle --check
xtask schema strict-diff
xtask impact explain --json
xtask impact audit --sample-skips N
xtask test --impact-mode=off --all

Do not add a new proof ledger just to track this. If cadence metadata is needed, it should live in existing xtask/workflow configuration and docs.

Acceptance criteria

  • Repeated required-input-key tests are moved toward a shared named-case harness.
  • Production-path source tests share common setup and laws while preserving family-specific exceptions.
  • Compile-fail fixtures remain individual files; only runner repetition is reduced.
  • Any new macro/table preserves nextest-visible per-case failure names.
  • PR/scheduled gate cadence is documented or encoded where it is currently ambiguous.
  • The issue does not weaken agent-default affected-test behavior.

Non-goals

  • No rewrite of the impact planner.
  • No disabling affected-test defaults for agents.
  • No generic owner-map bureaucracy unless it directly drives an existing gate.
  • No compression that turns useful named tests into one opaque mega-test.

Activity

  1. added
    area:xtask
    area:tests
    type:refactor
    cleanup
    area:qa
    on Jun 19, 2026
  2. Sinity commented on Jun 20, 2026

    @Sinity
    OwnerAuthor

    Reopened: #1983 completed one slice, not the whole issue

    #1983 was valid work, but it did not satisfy the full #1981 scope. It completed the required-input-key slice:

    • wired required_input_keys_test as a real sinexd integration target;
    • added shared required-key/readiness helpers;
    • preserved nextest-visible per-family test names;
    • repaired Atuin required fields and table-qualified SQLite required-key matching;
    • verified 16 required-input-key tests plus changed-strict.

    Remaining #1981 scope still open:

    • production-path source tests: shared production-path case catalog/common source-path laws while preserving parser-specific assertions;
    • fixture helpers: factor overlap between append-only/static-file fixtures without erasing their semantic distinction;
    • replay, chaos, and summarizer harnesses: extract repeated setup/assertion helpers where the same law is repeated;
    • compile-fail runner compression: keep individual diagnostic fixtures, reduce runner repetition only;
    • gate visibility/cadence: document or encode PR/scheduled cadence for changed-strict/impact evidence, generated docs/schema checks, strict-diff, and impact explain/audit where currently ambiguous.

    #1981 should close only after those remaining acceptance criteria are either implemented or explicitly moved into narrower live issues with concrete owners.

  3. reopened this on Jun 20, 2026
  4. 17 remaining items

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

    area:qaarea:testsarea:xtaskcleanuptype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions