feat(ignore): add reasonix ignore adapter - #2478
Merged
Merged
Conversation
…n denies Reasonix has no dedicated ignore file, so .rulesyncignore patterns are written as `Read(<pattern>)` entries in the `[permissions] deny` table of `reasonix.toml` (project) / `~/.reasonix/config.toml` (global). `deny` is the right target rather than `[sandbox] forbid_read`: deny rules take glob specifiers and are documented as a hard block in every mode, while forbid_read takes absolute paths with no documented glob support. The config file is already read-modify-written by the mcp and permissions features, so ignore is declared as a third writer in SHARED_CONFIG_OWNERSHIP and reuses the gateway's applyIgnoreReadDenies entry-level policy — the same one that resolves the ignore/permissions overlap in .claude/settings.json. Closes #2419 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…upe TOML helpers Adds the cross-feature data-loss regressions the shared-file contract test cannot catch (it treats arrays as leaves, so entries inside permissions.deny could vanish undetected): ignore-written Read denies surviving a later permissions write, permissions' explicit Read rules winning, and the mcp plugins block surviving both. Also extracts the TOML table/string-array narrowing that the reasonix ignore and permissions adapters had each spelled out, and notes in the docs that re-serialization does not preserve comments or key order. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Reasonix
ignoreadapter — the last open gap of #2419 (gaps 1-3 were closed by #2445)..rulesyncignorepatterns are now written asRead(<pattern>)entries into the[permissions] denytable ofreasonix.toml(project) /~/.reasonix/config.toml(global, via--global).Why
[permissions] denyand not[sandbox] forbid_readSPEC.md documents
denyrules as taking Claude-Code-style glob specifiers (Edit(docs/**)) and being "a hard block in every mode", whileforbid_readis documented as absolute paths/directories with no glob support. Ignore patterns are globs, sodenyis the only faithful target.Ownership
The config file is already read-modify-written by the
mcp(plugins) andpermissions(permissions/sandbox/agent) features, soignoreis declared as a third writer inSHARED_CONFIG_OWNERSHIPwith the samecustom/applyIgnoreReadDeniespolicy.claude/settings.jsonuses. That policy is what already resolves the overlap: onlyRead(...)deny entries are replaced, other deny entries and tables are preserved, and when the permissions feature manages theReadcategory its explicit rules win with a warning — the "possibly from ignore feature" guard inreasonix-permissions.tswas written for exactly this and is now reachable.reasonix.tomlis never deleted by rulesync (isDeletable()returnsfalse).Changes
src/features/ignore/reasonix-ignore.ts(+ unit tests), modeled onclaudecode-ignore.tswith the TOML codec from the shared gateway.reasonixregistered intoolIgnoreFactories,ignoreProcessorToolTargetTuple, and the global-capable ignore targets (both scopes have a config file).ignoredeclared on both Reasonix entries inshared-config-gateway.ts..gitignoreneeded no change.docs/reference/file-formats.mdprose +sync-skill-docs.ignorespec covers generate (project + global) and import forreasonix.Verification
pnpm cicheckgreen.npx vitest run --config vitest.e2e.config.ts src/e2e/e2e-ignore.spec.ts— 58 passed.Closes #2419
🤖 Generated with Claude Code