Repository navigation
test(sources): resurrect required input key suite (#1981) - #1983
Conversation
Problem The required-input-key source tests existed as orphan files that were not registered as a Cargo test target, so parser drift readiness regressions could survive normal xtask runs. Wiring them back in exposed current terminal declarative-source drift: Atuin did not mark essential columns as required, and the readiness matcher only compared exact removed keys even though SQLite drift reports table-qualified keys. What changed Registered the required_input_keys_test target, extracted the repeated parser/readiness assertions into a shared helper, updated the terminal source tests for current declarative parser types, marked Atuin command/timestamp columns required, and taught source drift readiness to match required column keys against table-qualified removed keys. Verification nix develop --command xtask fix --fmt-only --format human nix develop --command xtask test --allow-contended-host -p sinexd --test required_input_keys_test --format human Result: 16 tests passed, 0 failed. Ref #1981
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Free Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesRequired-key macro codegen, field annotations, and test consolidation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b77e53989c
ℹ️ 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".
| .rsplit_once('.') | ||
| .is_some_and(|(_, field)| field == required) |
There was a problem hiding this comment.
Restrict suffix matching to the intended SQLite table
When a sqlite_row source's database contains multiple tables, SqliteRowAdapter::input_fingerprint fingerprints the whole connection and SourceRecordFingerprint::from_sqlite_connection records columns as table.column, while SourceDefinition required keys are only column names. This suffix check therefore treats removal of any other table's command or timestamp column as a missing required key even if the configured table still has it, producing a blocking readiness caveat for optional drift; the match needs table/format context instead of accepting every dotted suffix.
Useful? React with 👍 / 👎.
Problem: the required-input readiness helper briefly used suffix matching so a removed key such as other_table.command could satisfy a required command field. Codex flagged that as too broad for multi-table SQLite material. What changed: generate table-qualified required input keys for declarative sqlite_row parsers when their baseline adapter config declares a table, and keep readiness drift matching exact. Verification: nix develop --command xtask fix --fmt-only --format human; nix develop --command xtask test --allow-contended-host -p sinexd --test required_input_keys_test --format human (16 passed).
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]>
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
Summary Registers and repairs the required-input-key source test suite so it is executed as a real `sinexd` integration target instead of surviving as orphaned files. The patch also extracts the repeated required-key/readiness assertions into a shared helper while preserving the existing per-family test names. Problem #1981 asks to compress repeated test implementation without losing affected-test/nextest observability. The required-input-key files named in the issue were not wired into `crate/sinexd/Cargo.toml`, so they were not protecting parser drift readiness at all. Once wired, the suite exposed current declarative terminal-source drift: Atuin did not mark its essential columns as required, and source drift readiness only matched exact removed keys, missing the declarative SQLite case where fingerprints report `table.column` but parser specs declare `column`. Solution - Add `required_input_keys_test` as a manifest-backed `sinexd` integration target. - Add a shared helper for repeated `required_input_keys` and readiness-caveat assertions. - Update the existing required-input-key files to use the helper while keeping per-family test functions visible to nextest. - Mark Atuin `timestamp` and `command` columns as required in the declarative source definition. - Teach source-shape drift readiness to match required unqualified tabular keys against table-qualified removed keys. Verification - `nix develop --command xtask fix --fmt-only --format human` Result: formatted packages. - `nix develop --command xtask test --allow-contended-host -p sinexd --test required_input_keys_test --format human` Result: 16 tests passed, 0 failed. - Pre-push hook: `xtask check --changed-strict origin/master --allow-contended-host` Result: changed-strict checked `sinex-primitives` and `sinexd`, all passed. Closes #1981 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Enhanced validation of required fields in data sources to ensure data integrity. * Improved error detection for missing required fields in imported records. * **Tests** * Expanded test coverage for required field validation across multiple data formats. * Implemented shared testing utilities for consistent validation coverage. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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]>
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
Summary Registers and repairs the required-input-key source test suite so it is executed as a real `sinexd` integration target instead of surviving as orphaned files. The patch also extracts the repeated required-key/readiness assertions into a shared helper while preserving the existing per-family test names. Problem #1981 asks to compress repeated test implementation without losing affected-test/nextest observability. The required-input-key files named in the issue were not wired into `crate/sinexd/Cargo.toml`, so they were not protecting parser drift readiness at all. Once wired, the suite exposed current declarative terminal-source drift: Atuin did not mark its essential columns as required, and source drift readiness only matched exact removed keys, missing the declarative SQLite case where fingerprints report `table.column` but parser specs declare `column`. Solution - Add `required_input_keys_test` as a manifest-backed `sinexd` integration target. - Add a shared helper for repeated `required_input_keys` and readiness-caveat assertions. - Update the existing required-input-key files to use the helper while keeping per-family test functions visible to nextest. - Mark Atuin `timestamp` and `command` columns as required in the declarative source definition. - Teach source-shape drift readiness to match required unqualified tabular keys against table-qualified removed keys. Verification - `nix develop --command xtask fix --fmt-only --format human` Result: formatted packages. - `nix develop --command xtask test --allow-contended-host -p sinexd --test required_input_keys_test --format human` Result: 16 tests passed, 0 failed. - Pre-push hook: `xtask check --changed-strict origin/master --allow-contended-host` Result: changed-strict checked `sinex-primitives` and `sinexd`, all passed. Closes #1981 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Enhanced validation of required fields in data sources to ensure data integrity. * Improved error detection for missing required fields in imported records. * **Tests** * Expanded test coverage for required field validation across multiple data formats. * Implemented shared testing utilities for consistent validation coverage. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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]>
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
Summary
Registers and repairs the required-input-key source test suite so it is executed as a real
sinexdintegration target instead of surviving as orphaned files. The patch also extracts the repeated required-key/readiness assertions into a shared helper while preserving the existing per-family test names.Problem
#1981 asks to compress repeated test implementation without losing affected-test/nextest observability. The required-input-key files named in the issue were not wired into
crate/sinexd/Cargo.toml, so they were not protecting parser drift readiness at all. Once wired, the suite exposed current declarative terminal-source drift: Atuin did not mark its essential columns as required, and source drift readiness only matched exact removed keys, missing the declarative SQLite case where fingerprints reporttable.columnbut parser specs declarecolumn.Solution
required_input_keys_testas a manifest-backedsinexdintegration target.required_input_keysand readiness-caveat assertions.timestampandcommandcolumns as required in the declarative source definition.Verification
nix develop --command xtask fix --fmt-only --format humanResult: formatted packages.
nix develop --command xtask test --allow-contended-host -p sinexd --test required_input_keys_test --format humanResult: 16 tests passed, 0 failed.
xtask check --changed-strict origin/master --allow-contended-hostResult: changed-strict checked
sinex-primitivesandsinexd, all passed.Closes #1981
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests