Skip to content

(janitor/test-prune): remove tautological security-agent settings field-set tests - #5830

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/test-prune/security-agent-settings-disjoint-fields
Open

(janitor/test-prune): remove tautological security-agent settings field-set tests#5830
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/test-prune/security-agent-settings-disjoint-fields

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the Task 9 settings screens each own a disjoint field set block (3 tests) from packages/app-shared/src/security-agent/settings.test.ts.

Each test constructs a patch object literal inside the test and then asserts Object.keys(patch) equals a hand-written list of the same keys. No production module is imported or invoked in the block — settings.ts exports no per-screen field-set definition — so the assertion is true by construction and no production regression can make it fail.

Why these tests cannot detect a regression

  • No production behavior: the block references no function from ./settings (or anywhere else). The object under assertion and the expected key list both live in the test body, so the only way the assertion changes is by editing the test itself.
  • The stated intent is untestable here: the comment claims the block proves "each settings screen submits only the fields it owns," but there is no screen component, submit handler, or patch-builder in the assertion path. That guarantee (if it exists anywhere) lives in the web/mobile settings screens, not in @kilocode/app-shared.
  • No security/auth/billing/data-integrity contract is affected.

Surviving coverage

The remaining tests in settings.test.ts still protect the real contracts in this module:

  • isSecurityConfigPatchDirty — scalar vs array patch comparison (lines 32–42)
  • parseDayCount / isValidDayCount — 1–365 whole-day parsing and validation (lines 105–137)
  • getSettingsDirtyState — clean / dirty-valid / dirty-invalid classification (lines 64–89)
  • getSettingsBackGuardOptions — save/discard/keep-editing back-guard options (lines 91–103)

Verification

  • vitest run for the package: 348 passed (17 files) (was 351 before removal)
  • tsgo --noEmit (package typecheck): clean
  • oxlint on the changed file: 0 warnings, 0 errors

…ld-set tests

Remove the "Task 9 settings screens each own a disjoint field set" block
from packages/app-shared/src/security-agent/settings.test.ts. Each of the
three tests builds a patch object literal inside the test and then asserts
that `Object.keys(patch)` equals a hand-written list of those same keys.
No production module is imported or invoked in the block: `settings.ts`
exports no per-screen field-set definition, so the assertion is true by
construction and no production behavior change can make it fail.

The block's stated intent — that each settings screen submits only the
fields it owns — is not exercised here (there is no screen component,
submit handler, or patch-builder in the assertion path), so removing it
changes no coverage. The surviving tests in the same file still protect the
real contracts: patch-dirty comparison, day-count parsing/validation,
dirty-state classification, and back-guard options.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 2, 2026
@kilo-code-bot

kilo-code-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • packages/app-shared/src/security-agent/settings.test.ts

Reviewed by grok-4.6 · Input: 104.1K · Output: 3.3K · Cached: 69.5K

Review guidance: REVIEW.md from base branch main

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

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants