Skip to content

refactor(tests): consolidate production-path harness (#1981) - #1988

Merged
Sinity merged 2 commits into
masterfrom
feature/refactor/verifiability-patterns-1981
Jun 20, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/refactor/verifiability-patterns-1981

Conversation

@Sinity

@Sinity Sinity commented Jun 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Consolidates the production-path source test harness without collapsing nextest-visible case names. The branch also factors duplicated append-only/static file fixture setup and records reopened source package gaps in the smoke matrix with issue-backed blocker metadata.

Problem

#1981 was reopened because #1983 only handled the required-input-key slice. Production-path source tests still repeated the same _run_case setup across source families, and append-only/static fixtures duplicated identical temp-file wiring. The issue explicitly asks to compress implementation while preserving per-case observability.

Solution

Added ProductionPathCase and run_production_path_case to keep the shared source-path law in one helper while leaving each test function named for nextest and impact evidence. Migrated the regular production-path obligation tests to named case constants, while leaving parser-specific, path-sensitive, and directory-entry cases explicit. Factored file fixture creation into build_file_fixture while preserving the append-only and static wrapper modules. Updated the smoke matrix to treat #847/#1033/#1043/#1469 package gaps as issue-backed blockers rather than pretending they are obsolete.

Acceptance Matrix

Verification

  • nix develop --command xtask test --allow-contended-host -p sinexd --test production_path --format human — 49 passed, 0 failed.
  • nix develop --command xtask check --changed-strict origin/master --allow-contended-host --format human — 1 affected package (sinexd) checked, all passed.
  • git diff --check — passed.

Ref #1981

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated the pull request verification checklist to clarify when and how to record impact evidence, including the appropriate command patterns for normal vs broad testing scopes.
  • Tests

    • Improved production-path obligation coverage by introducing reusable production-path test cases, simplifying how tests run the harness, and refining smoke-matrix validation to support explicitly blocked entries with documented blocker evidence.

Problem: #1981 still had duplicated production-path source tests and file fixture setup after the required-input-key slice landed. The duplication made it easy to change one source-family obligation shape without updating the others, while the issue explicitly requires preserving nextest-visible case names.

What changed: add a ProductionPathCase helper and migrate the regular production-path source obligations to named case constants, leaving parser-specific and path-sensitive tests explicit. Factor append-only/static file fixture setup through one helper while keeping semantic wrapper modules. Record reopened source-package blockers in the smoke matrix with issue-backed metadata, and add PR/docs guidance for impact evidence without introducing a new proof ledger.

Verification: nix develop --command xtask test --allow-contended-host -p sinexd --test production_path --format human (exact reusable proof from invocation 8: 49 passed); git diff --check.

Ref #1981

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Free

Run ID: 43e570a9-ad36-4091-a7c3-338d489b763e

📥 Commits

Reviewing files that changed from the base of the PR and between feebd4a and 066e5f0.

📒 Files selected for processing (1)
  • crate/sinexd/tests/sources/production_path/desktop.rs

📝 Walkthrough

Walkthrough

Introduces a ProductionPathCase struct and run_production_path_case async runner to replace repetitive _run_case/failures.is_empty() patterns across all production-path obligation tests. Consolidates temp-file fixture creation into a shared build_file_fixture helper with a FileFixtureKind enum. Adds a blocked_entry helper to the smoke coverage matrix with four new blocked entries and updates validation to accept Some(blocker_issue). Adds test-scope evidence recording instructions to the PR template and verification docs.

Changes

ProductionPathCase harness, fixture consolidation, smoke matrix, and docs

Layer / File(s) Summary
ProductionPathCase struct, runner, and shared file fixture helper
crate/sinexd/tests/sources/production_path.rs, crate/sinexd/tests/sources/production_path/fixtures/mod.rs, crate/sinexd/tests/sources/production_path/fixtures/append_only_file.rs, crate/sinexd/tests/sources/production_path/fixtures/static_file.rs
Introduces ProductionPathCase with const fn new, run_production_path_case runner that returns Err for non-empty failure lists, FileFixtureKind enum with Display, and build_file_fixture; both append_only_file and static_file fixture builders are reduced to single-call delegations to the shared helper.
Smoke matrix blocked entry helper and validation
crate/sinexd/tests/sources/production_path.rs
Adds blocked_entry(...) constructor that sets blocker_issue: Some(...), four new blocked matrix entries (email.mailbox, media.audio-transcript, media.screen-ocr, terminal.kitty-osc-live), and updated actionable-matrix validation that asserts blocker strings start with # and appear in entry evidence instead of requiring blocker_issue to be None.
Migration of all obligation tests to ProductionPathCase
crate/sinexd/tests/sources/production_path/ai_session.rs, browser.rs, desktop.rs, document.rs, export_parsers.rs, health_exports.rs, social_exports.rs, terminal.rs
Per-module ProductionPathCase constants replace inline _run_case calls with explicit ALL_OBLIGATIONS arguments and failures.is_empty() assertions; each test now awaits run_production_path_case(<CASE>) and maps errors via color_eyre. The desktop_window_manager_obligations test is refactored to parse Hyprland fixture events through a unix-socket adapter and run isolation/privacy obligation checks directly.
PR template and verification docs for test-scope evidence
.github/pull_request_template.md, xtask/docs/verification.md
Adds a Verification checklist item requiring xtask impact explain --json or xtask test --impact-mode=off --all output to be recorded when test-scope choice is material; inserts matching entries in the Verification Map and command-pattern snippets.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 A helper arose from the warren's deep test,
ProductionPathCase — a struct of the best.
No more failures.is_empty() scattered around,
One run_production_path_case call, cleanly bound.
Blocked matrix entries hop into their place,
With # as their marker — a fine coding grace!


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@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: feebd4a11e

ℹ️ 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".

&["browser.tab.active"],
);

const CLIPBOARD_CASE: crate::ProductionPathCase = crate::ProductionPathCase::new(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the window-manager obligation case

This migrated ProductionPathCase block omits the existing desktop.window-manager case: the parent had desktop_window_manager_obligations calling _run_case("desktop.window-manager", AdapterKind::UnixSocket, ..., ALL_OBLIGATIONS), and repo-wide search now finds no run_production_path_case/_run_case coverage for that source. The remaining desktop_window_manager_unix_socket_adapter_parses_hyprland_frame only checks two parsed frames, so replay/isolation/privacy stop running even though the smoke matrix still cites an obligation harness for desktop.window-manager.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 066e5f0: restored desktop_window_manager_obligations over the real Hyprland Unix-socket fixture and covered replay, isolation, and metadata-only privacy for desktop.window-manager. Focused verification: xtask test --allow-contended-host -p sinexd --test production_path --format human passed 50/50; pre-push xtask check --changed-strict origin/master --allow-contended-host passed for sinexd.

Problem: the production-path harness consolidation dropped the desktop.window-manager obligation test while the smoke matrix still described it as covered. That left the Unix socket adapter/parser path tested but not the replay, isolation, and metadata-only privacy obligations for the source.

What changed: shared the Hyprland socket fixture parsing helper between the parser assertion test and a restored desktop.window-manager obligation test. The obligation test now proves deterministic replay, fixture isolation, and metadata-only privacy handling for the UnixSocket path.

Verification: xtask test --allow-contended-host -p sinexd --test production_path --format human (50 passed, 0 failed).
@Sinity
Sinity merged commit 84a54a7 into master Jun 20, 2026
2 checks passed
@Sinity
Sinity deleted the feature/refactor/verifiability-patterns-1981 branch June 20, 2026 03:43
Sinity added a commit that referenced this pull request Jun 20, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
Sinity added a commit that referenced this pull request Jul 13, 2026
Summary

Consolidates the production-path source test harness without collapsing
nextest-visible case names. The branch also factors duplicated
append-only/static file fixture setup and records reopened source
package gaps in the smoke matrix with issue-backed blocker metadata.

Problem

#1981 was reopened because #1983 only handled the required-input-key
slice. Production-path source tests still repeated the same `_run_case`
setup across source families, and append-only/static fixtures duplicated
identical temp-file wiring. The issue explicitly asks to compress
implementation while preserving per-case observability.

Solution

Added `ProductionPathCase` and `run_production_path_case` to keep the
shared source-path law in one helper while leaving each test function
named for nextest and impact evidence. Migrated the regular
production-path obligation tests to named case constants, while leaving
parser-specific, path-sensitive, and directory-entry cases explicit.
Factored file fixture creation into `build_file_fixture` while
preserving the append-only and static wrapper modules. Updated the smoke
matrix to treat #847/#1033/#1043/#1469 package gaps as issue-backed
blockers rather than pretending they are obsolete.

Acceptance Matrix

- Satisfied: production-path source tests now share the common case
runner while preserving named tests.
- Satisfied: append-only/static file fixtures share setup without
erasing their semantic wrapper modules.
- Satisfied: gate visibility/cadence now asks PRs to record `xtask
impact explain --json` or broad full-test evidence when the
affected/default-test choice matters.
- Inspected/current: compile-fail runners already use wildcard runners
while preserving individual diagnostic fixtures, so this PR does not
churn them.
- Still open in #1981: replay, chaos, and summarizer harness cleanup.
This PR intentionally references #1981 rather than closing it.

Verification

- `nix develop --command xtask test --allow-contended-host -p sinexd
--test production_path --format human` — 49 passed, 0 failed.
- `nix develop --command xtask check --changed-strict origin/master
--allow-contended-host --format human` — 1 affected package (`sinexd`)
checked, all passed.
- `git diff --check` — passed.

Ref #1981


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **Documentation**
* Updated the pull request verification checklist to clarify when and
how to record impact evidence, including the appropriate command
patterns for normal vs broad testing scopes.

* **Tests**
* Improved production-path obligation coverage by introducing reusable
production-path test cases, simplifying how tests run the harness, and
refining smoke-matrix validation to support explicitly blocked entries
with documented blocker evidence.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude <[email protected]>
Sinity added a commit that referenced this pull request Jul 13, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
Sinity added a commit that referenced this pull request Jul 16, 2026
Summary

Consolidates the production-path source test harness without collapsing
nextest-visible case names. The branch also factors duplicated
append-only/static file fixture setup and records reopened source
package gaps in the smoke matrix with issue-backed blocker metadata.

Problem

#1981 was reopened because #1983 only handled the required-input-key
slice. Production-path source tests still repeated the same `_run_case`
setup across source families, and append-only/static fixtures duplicated
identical temp-file wiring. The issue explicitly asks to compress
implementation while preserving per-case observability.

Solution

Added `ProductionPathCase` and `run_production_path_case` to keep the
shared source-path law in one helper while leaving each test function
named for nextest and impact evidence. Migrated the regular
production-path obligation tests to named case constants, while leaving
parser-specific, path-sensitive, and directory-entry cases explicit.
Factored file fixture creation into `build_file_fixture` while
preserving the append-only and static wrapper modules. Updated the smoke
matrix to treat #847/#1033/#1043/#1469 package gaps as issue-backed
blockers rather than pretending they are obsolete.

Acceptance Matrix

- Satisfied: production-path source tests now share the common case
runner while preserving named tests.
- Satisfied: append-only/static file fixtures share setup without
erasing their semantic wrapper modules.
- Satisfied: gate visibility/cadence now asks PRs to record `xtask
impact explain --json` or broad full-test evidence when the
affected/default-test choice matters.
- Inspected/current: compile-fail runners already use wildcard runners
while preserving individual diagnostic fixtures, so this PR does not
churn them.
- Still open in #1981: replay, chaos, and summarizer harness cleanup.
This PR intentionally references #1981 rather than closing it.

Verification

- `nix develop --command xtask test --allow-contended-host -p sinexd
--test production_path --format human` — 49 passed, 0 failed.
- `nix develop --command xtask check --changed-strict origin/master
--allow-contended-host --format human` — 1 affected package (`sinexd`)
checked, all passed.
- `git diff --check` — passed.

Ref #1981


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **Documentation**
* Updated the pull request verification checklist to clarify when and
how to record impact evidence, including the appropriate command
patterns for normal vs broad testing scopes.

* **Tests**
* Improved production-path obligation coverage by introducing reusable
production-path test cases, simplifying how tests run the harness, and
refining smoke-matrix validation to support explicitly blocked entries
with documented blocker evidence.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude <[email protected]>
Sinity added a commit that referenced this pull request Jul 16, 2026
Summary

Finishes the two #1981 closure gaps found after the replay-harness PR: the last direct trybuild runner setup now uses a shared support helper, and the verification policy now names when sampled impact audits are required instead of only mentioning impact explain output.

Problem

The #1981 false-close pass found that prior work had compressed the primitives compile-fail runner and documented selected-test evidence, but sinex-macros still owned a one-off trybuild setup and the policy did not tell future agents when to run `xtask impact audit --sample-skips N`. That left the verification cleanup issue almost closed but not exhausted.

Solution

- Add `crate/sinex-macros/tests/support/trybuild.rs` and route the macros compile-fail test through it while keeping the individual fixtures and stderr outputs explicit.
- Extend `.github/ci-policy.md` with impact explain/audit cadence for disputed test-scope claims, impact-planner changes, verification-policy changes, and false-close audits.
- Extend `xtask/docs/verification.md` with an impact-plan coverage audit row and concrete command pattern.

Acceptance matrix

- Required-input-key suite compression: satisfied by #1983.
- Production-path source/common source-path laws: satisfied by #1988.
- Replay/chaos/summarizer harness compression: satisfied by #1992, #1994, #1998, and #2000.
- Compile-fail runner compression: satisfied by #1997 for `sinex-primitives` and by this PR for `sinex-macros`.
- Gate visibility/cadence: satisfied by #1988 for changed-strict guidance and by this PR for impact explain/audit cadence.

Verification

- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask test --debug --heavy --include-ignored -p sinex-macros -E 'test(compile_fail_tests)' --format human`  
  Passed: 1, Ignored: 0.
- `env -u SINEX_ROOT nix develop /realm/tmp/worktrees/sinex-1981-final --command xtask check --changed-strict origin/master --allow-contended-host --format human`  
  Passed locally.
- Pre-push `xtask check --changed-strict origin/master --allow-contended-host`  
  Passed: changed-strict checked `sinex-macros`.

Closes #1981
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant