Skip to content

refactor: renew verification, test helpers, and quality tooling contracts #274

Closed

Description

@Sinity

Context

The source renewals should finish with a dedicated verification pass. The test suite and devtools are in much better shape than before the mypy campaign, but they still contain older naming, duplicated helper seams, and some path-dependent fixtures/contracts that should align with the renewed substrate and surface contracts.

Scope

Focus on:

  • tests/
  • devtools/
  • generated quality/reference surfaces

The goal is not churn for its own sake. This PR should make verification surfaces reflect the post-renewal architecture cleanly.

Likely focus areas

  • contract-heavy test helpers and fixtures that still mirror old substrate/surface ambiguity
  • duplicated result/payload builders across unit suites
  • devtools quality/reference surfaces that still describe pre-renewal boundaries
  • remaining warning suppressions, naming drift, and weak helper contracts in verification-oriented code

Acceptance criteria

  • Shared fixtures/helpers are simplified where earlier substrate ambiguity forced duplication.
  • Devtools and generated quality references describe the live architecture accurately.
  • Remaining warning suppressions / naming drift / weak helper contracts in the targeted slices are reduced materially.
  • The tranche lands as one coherent PR with full verification.

Out of scope

  • Large new substrate features
  • User-facing behavior changes unrelated to verification quality

Activity

  1. added
    type:refactor
    on Apr 20, 2026
  2. Sinity commented on Apr 22, 2026

    @Sinity
    OwnerAuthor

    Starting #274 on branch feature/refactor/verification-contracts from master at d458ad18.

    Initial boundary:

    • Focus verification/test/devtools surfaces only.
    • Look first for duplicated payload/result builders, stale quality/devtools generated text, warning suppressions, and weak helper names/contracts.
    • Avoid broad behavior changes; this should be a verification-quality tranche, not new product functionality.

    I’ll keep the durable scratch log in .agent/scratch/274-verification-contracts.md and mirror meaningful decisions back here.

  3. Sinity commented on Apr 22, 2026

    @Sinity
    OwnerAuthor

    Implementation update for #274:

    Commit on feature/refactor/verification-contracts:

    • 1a7a12ed refactor(test): centralize JSON verification helpers

    Scope landed:

    • Added tests/infra/json_contracts.py for typed JSON object/envelope/result assertions.
    • Added direct tests for the shared JSON assertion helper.
    • Migrated repeated local JSON helper code out of CLI machine/check/product/deterministic-output tests.
    • Added a devtools validation-lane guard that fails if explicit pytest targets are duplicated in a lane.
    • Updated devtools render-quality-reference and regenerated docs/test-quality-workflows.md with a “Test Infrastructure Contracts” section naming the shared verification helpers.

    Verification:

    • pytest -q tests/infra/test_json_contracts.py tests/unit/cli/test_check.py tests/unit/cli/test_click_app_main.py tests/unit/cli/test_deterministic_output.py tests/unit/cli/test_json_envelope_contract.py tests/unit/cli/test_machine_main.py tests/unit/cli/test_products.py tests/unit/devtools/test_validation_lanes.py -> 293 passed in 9.84s
    • ruff check on touched files -> passed
    • mypy on touched files -> passed
    • devtools render-all --check -> passed
    • devtools verify -> verify: all checks passed
  4. Sinity commented on Apr 22, 2026

    @Sinity
    OwnerAuthor

    PR opened for #274:

    Local verification remains the closure signal for this tranche:

    • focused pytest: 293 passed in 9.84s
    • ruff check on touched files: passed
    • mypy on touched files: passed
    • devtools render-all --check: passed
    • devtools verify: verify: all checks passed
    • push hook devtools verify --quick: verify: all checks passed

    GitHub checks currently have the quick policy/lint/typecheck/Nix/security checks green; longer Python/showcase jobs are still running.

  5. Sinity commented on Apr 22, 2026

    @Sinity
    OwnerAuthor

    Closed by PR #366.

    Merge result:

    Verification used for merge readiness:

    • focused pytest: 293 passed in 9.84s
    • touched-file ruff check: passed
    • touched-file mypy: passed
    • devtools render-all --check: passed
    • devtools verify: verify: all checks passed
    • pre-push devtools verify --quick: verify: all checks passed

    GitHub state at merge time: mergeable; PR policy, lint, typecheck, Nix, showcase, GitGuardian, CodeRabbit, and CodeQL green. The three Python matrix jobs were still pending under the known Actions quota constraint, so I merged on the local full baseline plus the green non-matrix checks.

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:qatype:refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions