harness-guardrails
Harness guardrails derived from recent bug classes and regressions in the WorldArchitect engine.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- harness-guardrails
- description
- Harness guardrails derived from recent bug classes and regressions in the WorldArchitect engine.
03 SKILL.md 正文
Harness Guardrails (Added from Bug Analysis)
These guardrails are derived from recent bug classes and regressions in the WorldArchitect engine.
-
Vanilla JS Event Listeners: Do not use
.bind(this)inline withinaddEventListenerorremoveEventListener. Always store the bound function reference in the class constructor or initialization block to ensure proper removal and avoid memory leaks or dangling listeners (e.g.this.boundHandleClick = this.handleClick.bind(this)). -
Administrative State Poisoning: Any administrative override feature (e.g., God Mode, Pre-populated Templates) that bypasses standard LLM state-transition flows MUST explicitly enforce cleanup for orthogonal game states (like
in_combat=Falseorcharacter_creation_in_progress=False). -
DRY Constant Extraction: When modifying logic that relies on hardcoded lists or tuples (like stripping cooldown fields), you MUST search the repository for duplicates and extract them to a canonical constant to prevent
NameErrorhazards during rebases. -
ZFC Pre-flight Before Any Server-Side Choice Injection: Before adding ANY
_inject_*,_fallback_*,_ensure_*, or_repair_*function that touches model output (planning_block, choices, rewards_box), answer all 3 questions: (1) Does the model have explicit instructions for this output in the agent prompt/system instruction? (2) Can a prompt fix this? (3) If yes, fix the prompt FIRST. Only add backend logic after prompt fix fails with evidence. PR #6908: 61 commits from skipping this — root was a missing JSON example in LevelUpAgent prompt. -
PR Commit Count Alarm: If a PR accumulates >15 commits on a single behavioral theme (e.g., "planning_block", "finish choices", "level-up state"), STOP before the next backend commit and run the product plugin's leveling alignment check, if one is installed. A commit count spike on a stable theme reliably indicates symptom-patching rather than root-cause repair. At 30+ commits: require human review of root-cause hypothesis. PR #6908 was the incident: 61 commits before the 5-line root-cause fix was written.
-
Server CANNOT inject planning choices: The server may persist, normalize, and validate model output. It MUST NOT infer, inject, or synthesize planning choices.
server_generated: Trueon aplanning_blockis always a bug signal, not an acceptable state. Any code path that setsserver_generated=Trueand then RETURNS that block to the caller is a ZFC violation. -
Opaque handles are not semantic contracts: Choice IDs and other transport handles are for lookup, persistence, and migration compatibility only. Legacy IDs such as
level_up_now,finish_level_up_return_to_game, andcustom_actionmay remain exact compatibility handles, but new code MUST NOT infer domain, modal ownership, stage, allowed/scrubbed status, or execution behavior from ID names, prefixes, labels, CSS classes, or enum strings. Resolve a submitted handle against the persisted structured choice, then use explicit schema-owned fields such asintent.domain,intent.operation, orexecution.freeze_time. If those fields are missing, fix the model prompt/schema or fail closed; do not expand allowlists as the primary repair. -
Playwright UI Testing & Pre-Push Validation: When introducing any new browser, selenium, or Playwright tests for Gate 6 evidence:
- Pytest Integration: Never use standalone
.pyscripts withsys.exit(). Always wrap browser checks in standard pytest classes/methods (test_*). - Dynamic Path Resolution: Always resolve local files using absolute paths via
os.path.dirname(os.path.abspath(__file__)). Never use relative../orfile://./URLs which fail on CI runners. - Error visibility and skip paths: Import-skip when Playwright is unavailable using
pytest.importorskip("playwright.sync_api"). Do not use broad exception suppressions that hide actual navigation timeouts or setup errors. - Pre-Push Verification: Eagerly run the specific targeted test locally via
./vpython -m pytest <path_to_new_test>and verify it passes before pushing.
- Pytest Integration: Never use standalone
04 同仓库更多 Skills
disk-reclaim-playbook
Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.
claudea-bench
Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
pr
Alias for the canonical pr-lifecycle PR workflow skill (/pr-workflow, /prw).
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
pr-report
This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, /pr-report, or wants per-PR summary with delta files/lines. Generates a structured report for one or more open PRs covering purpose, files changed, +/− line counts, /code-standards + /thermo review findings, /ponytail simplification opportunities, file-overlap combination candidates, and /green status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.