rulesync icon indicating copy to clipboard operation
rulesync copied to clipboard

Follow up Factory Droid upstream updates: commandBlocklist hard-block permission tier

Open dyoshikawa opened this issue 5 months ago • 4 comments

Summary

Factory Droid's settings.json defines three command permission tiers, but rulesync models only two (commandAllowlist/commandDenylist, tracked previously). The hard-block tier commandBlocklist has no representation.

Recent Releases

  • Settings reference (current as of 2026-06-15): https://docs.factory.ai/cli/configuration/settings

Gaps

  • permissions — commandBlocklist (hard-block tier) not modeled. Factory Droid settings.json has commandAllowlist, commandDenylist, and commandBlocklist. The blocklist is a distinct, stronger tier: blocked commands "can never run… no prompt and no way to approve them: the block applies even under full autonomy, auto-run, or --skip-permissions-unsafe," and the resolver inspects the actual program invoked to prevent wrapper bypasses. The denylist only forces confirmation and can be approved. src/features/permissions/factorydroid-permissions.ts models only commandAllowlist/commandDenylist; commandBlocklist appears nowhere in src/. The canonical action model in src/types/permissions.ts is allow | ask | deny only — there is no "block" action, so the never-run-even-under-autonomy semantic cannot be expressed or round-tripped, and an existing commandBlocklist is silently ignored on import (preserved only as a non-managed key).

Proposed Follow-up

  • Decide how to represent Factory's hard-block tier: either (a) introduce a canonical "block"/stronger-than-deny action mapped to commandBlocklist, or (b) at minimum read/preserve commandBlocklist explicitly and document that rulesync does not manage it.

References

  • https://docs.factory.ai/cli/configuration/settings — commandAllowlist / commandDenylist / commandBlocklist semantics.

dyoshikawa avatar Jun 16 '26 06:06 dyoshikawa

Re-validated against current upstream and code; leaving open as a maintainer design decision.

Upstream is real and current. Factory Droid settings.json has three permission tiers: commandAllowlist, commandDenylist, and commandBlocklist. The blocklist is a hard block — "commands in this array can never run … no prompt and no way to approve them: the block applies even under full autonomy, auto-run, or --skip-permissions-unsafe", and it always takes precedence. Source: https://docs.factory.ai/cli/configuration/settings

Gap is real but partial. factorydroid-permissions.ts models only commandAllowlist/commandDenylist. On generate, an existing commandBlocklist is preserved verbatim as an unmanaged key (the { ...settings } spread), so it is not destroyed. On import (toRulesyncPermissions), only allow/deny are read, so the blocklist is dropped from rulesync's canonical model. rulesync's canonical action enum is allow/ask/deny only — there is no never-run tier.

Why this needs a decision. The two paths are mutually exclusive:

  • (a) Introduce a canonical "block" action stronger than "deny". This touches the shared PermissionActionSchema in src/types/permissions.ts and forces every other permissions adapter (~20 tools) to decide how to map/degrade an unknown "block" action. High blast radius.
  • (b) Minimal: explicitly model and preserve commandBlocklist on import (non-destructive round-trip) and document that rulesync does not otherwise manage it. Low blast radius, but the only behavioral delta over today is making import non-destructive.

Recommend deciding between (a), (b), or "working as intended / close".

dyoshikawa avatar Jun 16 '26 09:06 dyoshikawa

Upstream update (re-check on 2026-06-18)

Adding one low-confidence watch item alongside the commandBlocklist tier tracked here.

Newly found releases / changes

  • Factory Droid v0.96.0 (2026-04-07) — "design.md support: CLI now supports design.md files alongside agents.md for providing design guidelines." Source: https://docs.factory.ai/changelog/release-notes (v0.96.0).

Additional or changed gaps

  • rules — design.md not represented (watch item, low confidence). Factory's changelog says the CLI reads a design.md design-guidelines file alongside AGENTS.md. src/features/rules/factorydroid-rule.ts emits only AGENTS.md + .factory/rules/*, and rulesync has no canonical "design" surface to map it to. Caveat: this is changelog-only — it is not yet described on the primary config-reference pages (/cli/configuration/agents-md, /cli/getting-started/overview), so its exact location/precedence is unverified. Do not implement on changelog text alone; revisit if/when a config-reference page documents design.md.

References

  • https://docs.factory.ai/changelog/release-notes — v0.96.0 (2026-04-07) design.md support.
  • https://docs.factory.ai/cli/configuration/settings — current settings reference (no design.md entry yet).

dyoshikawa avatar Jun 19 '26 04:06 dyoshikawa

Triaged — leaving open pending a maintainer design decision.

Verified (real gap). Factory Droid's settings.json defines three command-permission tiers: commandAllowlist, commandDenylist, and commandBlocklist. The blocklist is a distinct, stronger tier — blocked commands "can never run… no prompt and no way to approve them," applying even under full autonomy / auto-run / --skip-permissions-unsafe, with the resolver inspecting the actual invoked program to prevent wrapper bypasses (https://docs.factory.ai/cli/configuration/settings). rulesync's factorydroid-permissions.ts models only commandAllowlist/commandDenylist.

Why this is not a bare mapping — design decision needed. rulesync's canonical action model (src/types/permissions.ts) is allow | ask | deny only. deny maps to Factory's commandDenylist (forces confirmation, approvable). There is no canonical action expressing "never run, not even under autonomy" (a hard block). So commandBlocklist cannot be represented or round-tripped today, and an existing one is silently ignored on import (preserved only as a non-managed key).

Decision needed from a maintainer: whether to (a) add a fourth canonical action (e.g. block) to the rulesync permission model so hard-block tiers across tools can be expressed — a cross-cutting change touching every permission adapter and the canonical schema; (b) approximate commandBlocklist by collapsing it onto deny (lossy — loses the never-approvable guarantee); or (c) at minimum preserve an existing commandBlocklist verbatim on round-trip (read-merge-write) without modeling it canonically. Leaving open and labeled for that design discussion rather than forcing a lossy mapping that would silently weaken a hard block to an approvable deny.

dyoshikawa avatar Jun 20 '26 00:06 dyoshikawa

Upstream update (re-check on 2026-06-22)

Beyond the commandBlocklist tier this issue tracks, the Factory Droid re-check surfaced two additional gaps in the same area.

Additional gaps

  • permissions/settings — settings.local.json override files not emitted/recognized (unsupported). Factory Droid merges project <repo>/.factory/settings.local.json and user ~/.factory/settings.local.json on top of settings.json (gitignored machine-specific prefs). rulesync only reads/writes .factory/settings.json (FACTORYDROID_SETTINGS_FILE_NAME); there is no local-override file mode (compare to Claude Code's settings.local.json handling that already exists in claudecode-ignore.ts). Source: https://docs.factory.ai/cli/configuration/settings
  • rules — global ~/.factory/rules/ non-root not emitted (global lossy). Personal rules across all projects live in ~/.factory/rules/*.md (and nested subdirs), read identically to project rules. FactorydroidRule.getSettablePaths({ global: true }) returns only a root entry (.factory/AGENTS.md) with no nonRoot, so global non-root rules collapse into a single ~/.factory/AGENTS.md instead of ~/.factory/rules/ (confirmed via --global dry-run). Source: https://docs.factory.ai/guides/power-user/rules-conventions

References

  • https://docs.factory.ai/cli/configuration/settings — settings.local.json merge layer.
  • https://docs.factory.ai/guides/power-user/rules-conventions — global ~/.factory/rules/.

dyoshikawa avatar Jun 22 '26 07:06 dyoshikawa