4. Visual Geometry & Copy Gates

4.3 Deterministic Editorial & Copy Gate

python3 scripts/verify-copy-declaration.py

How Chinwag enforces editorial clarity, canonical product terminology, and zero leak invariants across marketing and documentation commits.

4.3 Deterministic Editorial & Copy Gate

python3 scripts/verify-copy-declaration.py

✅ Available Now (v0.1.0 · CHWG-PUB-106): The deterministic 64/64 Declaration Copy Gate (verify-copy-declaration.py · INV-DECLARATION-COPY-GATE-01) and Zero-Leak Gate (verify-docs-zero-leak.py · INV-DOCS-ZERO-LEAK-01) are shipped and enforced on every build in v0.1.0 (0 Credits).

When multiple AI coding agents and engineers ship documentation, UI microcopy, and release notes in parallel, terminology drifts rapidly. One agent invents a non-existent CLI flag, another writes vague AI-marketing filler, and a third accidentally embeds an unrendered math macro or an internal private IP address into a public page.

The Declaration Copy Gate (INV-DECLARATION-COPY-GATE-01) is a deterministic 64/64 lexical, structural, and cryptographic terminology gate that runs locally in under 150ms at 0 Cr (free) before any user-facing HTML or Markdown change can advance to review.

chinwag ui-gate --copy-only --strict

The 4 Pillar Categories of the 64/64 Copy Gate

The 64 deterministic checks are divided into four 16-rule pillars:

PillarRulesWhat It Enforces
1. Zero-Leak & Sanitization (COPY-01..COPY-16)16Blocks RFC1918/CGNAT private IP ranges, local workstation home paths, internal model routing identifiers, and unescaped secret patterns.
2. Rendering & Typography Hygiene (COPY-17..COPY-32)16Blocks raw unrendered TeX/LaTeX backslash macros, broken Markdown tables, orphaned HTML tags, missing code-fence language specifiers, and broken relative links.
3. Canonical Product & Pricing Truth (COPY-33..COPY-48)16Verifies that every referenced CLI command (chinwag pair, chinwag ui-gate, chinwag board push) matches the live CLI grammar and every credit figure matches the canonical OrgCreditScheduleV1.
4. Editorial Clarity & Anti-Slop (COPY-49..COPY-64)16Rejects vague filler phrases, enforces concrete numeric proof (<20ms, 176/176, +1,408 bytes), requires outcome-first headings, and verifies CTA anchor consistency.

Policy Configuration in chinwag.workflow.yaml

You can customize your organization's canonical glossary, forbidden terms, and required link targets directly in chinwag.workflow.yaml:

copy_gate:
  enabled: true
  invariant_id: INV-DECLARATION-COPY-GATE-01
  fail_closed: true
  zero_leak:
    forbid_private_ips: true
    forbid_local_home_paths: true
    forbid_raw_latex_macros: true
  terminology:
    canonical_terms:
      "Chinwag Reflex-1": ["reflex-1-raw", "internal-fast-router"]
      "Chinwag Delivery-2": ["delivery-2-internal"]
      "Chinwag Vision-3": ["vision-3-internal"]
      "Shadow jj Workspace": ["git stash worktree hack"]
  editorial:
    require_code_fence_language: true
    max_heading_words: 14

Example Copy Gate Output

$ chinwag ui-gate --copy-only
[copy-gate] Auditing 36 Markdown files + 5 HTML templates against 64 rules...
  ✓ Pillar 1: Zero-Leak & Sanitization (16/16 passed)
  ✓ Pillar 2: Rendering & Typography Hygiene (16/16 passed)
  ✓ Pillar 3: Canonical Product & Pricing Truth (16/16 passed)
  ✓ Pillar 4: Editorial Clarity & Anti-Slop (16/16 passed)
[copy-gate] PASS: 64/64 Declaration Copy Invariants verified in 48ms (0 Cr).

Next Steps