Heuristic:0xNyk Council of high intelligence Grep Based Parity Checks
| Knowledge Sources | |
|---|---|
| Domains | Testing, CI, Protocol_Maintenance |
| Last Updated | 2026-10-20 00:00 GMT |
Overview
Use `grep -q` feature-string checks across all SKILL mirror files in CI to catch protocol feature drift — when a feature is added to `SKILL.md` but not mirrored to `SKILL.codex.md`, `SKILL.gemini.md`, or `SKILL.opencode.md`.
Description
Grep-Based Parity Checks are the CI validation strategy used by `scripts/council-simulation-checklist.sh` to ensure protocol features defined in the canonical `SKILL.md` are present in all mirror files. Each protocol feature is represented by a distinctive string (e.g., `"Anti-conformity directive"`, `"STANCE:"`, `"openai_compatible_api"`, `"schema_version: 1"`), and the checklist greps for that string in every mirror file.
This pattern was motivated by real regressions: the Gemini mirror (`SKILL.gemini.md`) once shipped without features that existed in `SKILL.md`, and the regression was only caught after users reported missing functionality. The grep checks turn this post-hoc discovery into a CI gate — a missing feature string causes an immediate `fail` with a specific error message identifying the file and issue.
The checks cover: Round 2 anonymization, anti-conformity directive (must appear ≥3 times in SKILL.md — one per Round 2 prompt), Chairman role, verdict actionability sections, OpenAI-compatible API archetype, Session Metadata schema, structured stance lines, weighted tally, 1.5× domain-weight seat, and 2/3 consensus threshold.
Usage
Use this heuristic whenever modifying protocol features in `SKILL.md`. After adding or changing a feature, the checklist greps must be updated to verify the feature appears in all mirror files. Run `./scripts/council-simulation-checklist.sh` as a CI gate on every PR that touches SKILL files.
The CLAUDE.md project conventions explicitly state: "When changing protocol features in `SKILL.md`, mirror them in `SKILL.codex.md`, `SKILL.gemini.md`, and `SKILL.opencode.md` (or document why a host is exempt) — the checklist verifies parity."
The Insight (Rule of Thumb)
- Action: For each protocol feature, add a `grep -q "feature_string" "${skill_file}" || fail "..."` check to `council-simulation-checklist.sh` that runs across all mirror files.
- Value: Use distinctive, unambiguous strings — `"STANCE:"`, `"schema_version: 1"`, `"Anti-conformity directive"`. Avoid generic strings that could match unrelated content. For features that must appear multiple times (e.g., anti-conformity in 3 Round 2 prompts), use `grep -c` with a count threshold.
- Trade-off: Grep checks verify presence of a string, not semantic correctness — a feature could be present but incorrectly implemented. The trade-off is acceptable: string presence catches the most common failure mode (feature not mirrored at all), and semantic verification would require running the full protocol, which is expensive.
- Compatibility: Works on any Unix system with `grep`. The opencode mirror (`SKILL.opencode.md`) is currently exempt from content-parity greps — it is existence/lint-guarded only, with a documented exemption in the checklist (L171-175) noting it lacks E3, E9, E7, and Asset Resolution.
Reasoning
Protocol mirroring is inherently error-prone: a feature is designed and written in `SKILL.md` first, then manually compressed and mirrored into `SKILL.codex.md`, `SKILL.gemini.md`, and `SKILL.opencode.md`. Each mirror is a separate file with its own compression strategy, and a feature can be dropped during compression without any immediate signal — the skill still "works" because the canonical file is correct.
The grep strategy works because protocol features in this project are always associated with distinctive literal strings: section headers (`"Acceptable Compromises"`), protocol markers (`"STANCE:"`, `"CHECKPOINT"`, `"VERIFY"`), flag names (`"--quick"`, `"--duo"`), and schema markers (`"schema_version: 1"`). These strings are unlikely to appear by accident, so their presence is a strong signal that the feature was mirrored.
The count-based check for the anti-conformity directive (`grep -c "Anti-conformity directive" SKILL.md` must return ≥3) catches a subtler failure: the directive must appear in all three Round 2 prompt templates (full, quick, duo modes). A count of 2 means one mode's Round 2 prompt is missing the directive.
The opencode exemption is explicitly documented in the checklist source (L171-175) with the specific missing features listed: E3 (reasoning_method), E9 (confidence factors), E7 (.council.yaml overrides), and Asset Resolution. This transforms a silent gap into a tracked, acknowledged one — the checklist will be extended "once it reaches feature parity."