Skip to content

atebites-hub/factory-policy

v0.1.1MIT

v1 warn-default; not a Factory default. Catalog-listed for pin install (+ memory gate).

factory-policy

v1 warn-default — not a Factory default.

Inline marketplace plugin in atebites-plugins. Not a submodule. Catalog-listed for pin install as factory-policy@atebites-plugins. Not a Factory-wide acceptance claim. Project Factory seats it in enabledPlugins as a warn-default template pin. Real checkers run for C3.1, C3.2, C3.3, C5, and C6. Default mode is warn (stderr WARN [C3.2] … + Fix:, exit 0). Dial fail via config. C7 is a warn-only stub. Do not treat a skipped hook as a pass.

Current status: docs/POLICY-V1.md. Historical spike note: docs/SPIKE-FACTORY-POLICY.md. C3–C7 SoT: factory-01-policy-layer.md, policy-gate.md, Build Sheet §5 (PJTemplate handoff).

What this is

P2 upgraded reasoning-system. factory-policy enforces the task-memory ledger. memory-system stays inside this plugin (keep the name). The ledger path in a consumer repo is still docs/memories/.

Native models reason. The policy-gate skill is the memory field contract only — it does not call sequentialthinking.

Skills

SkillRole
policy-gateField contract + how to satisfy C3.1, C3.2, C3.3, C5, C6, C7
memory-systemRead/write docs/memories/ from the template

Named checks

IDNameDefault
C3.1doc-citedwarn
C3.2scope-literal (inline | open-dynamic-workflows)warn
C3.3plan-filledwarn
C5gate-runnablewarn
C6issue-linkedwarn
C7plan-approved (not implemented in v1)warn stub

C4 is not in the binding investigation ID list. This plugin does not invent it.

Config overlay

Shipped defaults: config/policy.toml (all named checks warn).

# Consumer repo
cp path/to/factory-policy/config/policy.toml config/factory-policy.toml
# edit modes: warn | fail | off
# optional: widen [paths] code if durable edits live outside src/**

# Or point at any TOML:
export FACTORY_POLICY_CONFIG="$PWD/config/factory-policy.toml"

Search order: --config, $FACTORY_POLICY_CONFIG, <repo>/config/factory-policy.toml, then the shipped file.

Default [paths] code = ["src/**"]. An overlay list replaces the shipped globs (it does not union unless you repeat src/**):

[paths]
code = ["backend/**", "frontend/**", "src/**"]

Skip lines say code paths … skipped (not a pass). A skip is not a pass. This plugin is still not a Factory default.

Hooks / scripts

ScriptEventv1
scripts/policy-gate.shPreToolUse / preToolUsecheck-memory <path> (0/1/2/3); edit reads stdin JSON, skips paths outside [paths].code (default src/**), require in_progress memory. Warn → 0. Fail-mode → 2
scripts/stop-verify.shStop / stopCheckers when configured code paths changed; hop cap stub (TBD)
scripts/guard-bash.shTier 1 gitStaged code paths → same checkers (git exit 1 on fail); optional regex deny

JSON pointers: hooks/claude-codex-hooks.json, hooks/cursor-hooks.json.

ZCode uses hooks/zcode-hooks.json, registered by its plugin manifest, with native process handlers and timeoutMs. Enable hooks.enabled in the host's user configuration for these handlers to run. A skills-only installation does not provide PreToolUse or Stop enforcement.

Checker: scripts/check_memory_policy.py (structured [C3.2] / WARN [C3.2] findings). Environment errors fail-open in hooks (one stderr line). check-memory uses the §2.1 contract (missing python → 3).

Not in this plugin

  • CE, taskboard, j-space (discarded from Factory — not defaults)
  • Catalog install as a factory-default
  • C7 Approved-by git-history enforcement
  • F1 / D1 / J1 / S12

Opt-in (not Factory-default)

Catalog pin: factory-policy@atebites-plugins (v1 warn-default; not a Factory default). Installability only — still not a Factory-wide enabledPlugins default. After a local clone:

agent --plugin-dir "$PWD/plugins/factory-policy"
bash plugins/factory-policy/scripts/policy-gate.sh check-memory docs/memories/YYYY-MM-DD-slug.md

QA fail-mode VERDICT is required before this becomes a Factory default.