Skip to content

fix: address mid-severity follow-ups from PR #1570 and PR #1585#1589

Merged
dyoshikawa merged 3 commits into
mainfrom
feat/issues-1571-1587-followups
May 1, 2026
Merged

fix: address mid-severity follow-ups from PR #1570 and PR #1585#1589
dyoshikawa merged 3 commits into
mainfrom
feat/issues-1571-1587-followups

Conversation

@dyoshikawa
Copy link
Copy Markdown
Owner

@dyoshikawa dyoshikawa commented Apr 30, 2026

Summary

Addresses mid-severity findings from two follow-up issues, plus low-severity quality improvements from a follow-up review.

Closes #1571
Closes #1587

Issue #1571--input-root follow-ups (PR #1570)

  • A: src/cli/commands/import.ts — clarify the warning-suppression comment so it accurately reflects that only direct CLI/programmatic callers are protected; users with an inputRoot set in rulesync.jsonc may still see the actionable warning.
  • B: Add inputRoot threading assertions to the per-feature processor unit tests for rules, subagents, skills, hooks, permissions, and ignore (modeled after commands-processor.test.ts). A regression that swaps inputRoot for process.cwd() is now caught at the unit level.
  • C: src/utils/file.ts — make validateBaseDir's ..-segment split platform-aware (/[/\\\\]/ on Windows, /\\// on POSIX) so POSIX filenames containing literal backslashes round-trip cleanly.

Issue #1587 — permissions follow-ups (PR #1585)

  • D: Implement real validate() for cline/augmentcode/qwencode permissions modules via JSON.parse + safeParse (mirrors Kilo's pattern). The previous no-op meant fromFile({ validate: true }) did not actually verify schema conformance.
  • E: Drop the **/kilo.jsonc gitignore entry — parity with the structurally-identical opencode.jsonc (no entry) since the translator preserves non-permissions Kilo settings on round-trip.
  • F: AugmentCode shellInputRegex import: emit logger.warn when the regex is non-roundtrippable. For deny only, fall back to * (fail-closed). For allow/ask, warn but keep the lossy conversion to avoid weakening security via broadened allow patterns.

Quality improvements (commit 655dd25)

  • Fix grammatical typo in the import.ts warning-suppression comment (a inputRootan inputRoot).
  • Replace a redundant post-load readFileContent re-read in rules-processor.test.ts with assertions on the loaded RulesyncRule instance, so the inputRoot test verifies the processor actually parsed content from inputRoot.
  • Tighten the four "non-roundtrippable shellInputRegex import" tests in augmentcode-permissions.test.ts to assert on logger.warn message contents (regex, tool name, fail-closed wording for deny, "Importing as glob" wording for allow/ask).

Test plan

  • pnpm cicheck passes (216 test files / 5480 tests)
  • e2e-permissions and e2e-input-root suites pass
  • New unit tests added for Findings B, D, F
  • Tool × Feature happy-path E2E coverage preserved
  • Agent-team review converged with 0 high/critical, 0 mid, 0 low findings on the quality-improvement commit

🤖 Generated with Claude Code

dyoshikawa and others added 3 commits April 30, 2026 07:48
Refs: #1571, #1587

Issue #1571 (--input-root follow-ups):
- import.ts: clarify warning suppression scope in comment
- add inputRoot threading assertions to rules/subagents/skills/hooks/permissions/ignore processor tests
- validateBaseDir: make '..' segment check platform-aware

Issue #1587 (permissions follow-ups):
- cline/augmentcode/qwencode: implement real validate() via safeParse
- gitignore-entries: drop **/kilo.jsonc entry for parity with opencode.jsonc
- augmentcode: warn on non-roundtrippable shellInputRegex; deny falls back to '*' (fail-closed)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Fix grammatical typo in import.ts comment: 'a inputRoot' -> 'an inputRoot'.
- Replace redundant assertion in rules-processor inputRoot test that
  re-read the just-written file; assert on the loaded RulesyncRule's
  parsed frontmatter and body instead, which actually verifies the
  processor consumed the inputRoot.
- Add warn-message content assertions to the new non-roundtrippable
  shellInputRegex import tests in augmentcode-permissions.test.ts:
  spy on ConsoleLogger.prototype.warn so the asymmetric fallback
  semantics (deny -> '*' fail-closed; allow/ask -> lossy with warning)
  are observable from tests, not just the resulting glob.

The pre-existing constructor issue flagged by the previous review (the
constructor not invoking validate() when params.validate is true) is
intentionally NOT addressed: it predates this PR (the previous validate()
returned a no-op success, so wiring it up is a behavioral change), would
require touching three modules outside the converged scope of issues
#1571 and #1587, and is better tracked as its own follow-up issue.
…structors

Address review findings on PR #1589:

- #1 (mid): Wire `validate()` into the constructors of AugmentcodePermissions,
  ClinePermissions, and QwencodePermissions so that `fromFile({ validate: true })`
  actually rejects malformed input. Previously the validate() method existed but
  was never invoked at construction time, so callers reading `validate: true`
  falsely assumed validation had run. Mirrors the RulesyncPermissions pattern.
- #3 (low): Drop PR-internal label `(Finding F)` from the describe title in
  augmentcode-permissions.test.ts since it is meaningless after merge.
- #4 (low): Add a co-located inner `afterEach` that restores the warnSpy on
  ConsoleLogger.prototype, instead of relying on the outer describe's
  vi.restoreAllMocks(). Keeps the cleanup next to the spy so future refactors
  cannot silently leak the prototype-level spy across other test files.

Adds three constructor-level rejection tests per class (malformed JSON, schema
violation, and a validate: false escape hatch) so future regressions are caught.
@dyoshikawa dyoshikawa merged commit 5441556 into main May 1, 2026
9 checks passed
@dyoshikawa dyoshikawa deleted the feat/issues-1571-1587-followups branch May 1, 2026 05:39
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.

Permissions translation: follow-ups from PR #1585 multi-agent review Follow-up: address mid-severity review findings from PR #1570 (--input-root)

1 participant