harness-verification
Authoritative Harness Engineering Protocol: machine-readable spec requirements, documentation-to-test mapping, baseline-seed verification, runtime guardrails, handover certification, and drift management — issuing a Harness Pass Certificate.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 25
- Forks
- 9
01 前言 Front Matter
- name
- harness-verification
- owner
- cpa-auditor
- scope
- co-price
- status
- active
- version
- 2.1.0
- metadata
- { "type": "quality", "triggers": [ "verify engine", "harness pass", "run verification protocol" ] }
- relates_to
- [ { "type": "follows", "skill": "double-entry-reconciliation" }, { "type": "composes_with", "skill": "i18n-audit" }, { "type": "composes_with", "skill": "pricing-playbook" }, { "type": "composes_with", "skill": "i18n-audit" }, { "type": "composes_with", "skill": "scenario-comparison" }, { "type": "composes_with", "skill": "prisma-7" }, { "type": "composes_with", "skill": "ui-component-design" } ]
- description
- Authoritative Harness Engineering Protocol: machine-readable spec requirements, documentation-to-test mapping, baseline-seed verification, runtime guardrails, handover certification, and drift management — issuing a Harness Pass Certificate.
- last_reviewed
- 2026-08-25
- prerequisites
- docs/biz_logic.md section anchors exist; ACME baseline seed available
03 SKILL.md 正文
Harness Engineering Protocol — AIG Agentic Standard
This skill is the single authoritative procedure for making documentation machine-readable
and implementation verifiable, so AI agents can harness documents to drive autonomous
development and validation. (Absorbed the former docs/harness_protocol.md document, 2026-08-25.)
Trigger
Execute after any write to src/lib/simulation.ts, src/lib/engine/*, or related business logic.
1. Machine-Readable Specifications
- Mathematical formulas: all business formulas written in LaTeX in
docs/biz_logic.mdso agents can parse equations into TypeScript. - JSON schema references: any complex structure mentioned in
architecture.mdmust have a matching TypeScript interface insrc/lib/types.ts(documentation-to-code alignment).
2. Verification Steps (the original five gates)
- Zod Schema Verification: all new inputs covered by
src/lib/schemas.ts. - Math Precision Check:
mathjsused for all floating-point math — never native+ - * /. - Documentation Mapping: implemented logic documented in
biz_logic.mdwith LaTeX formulas. - Test Harness:
[Ref: biz_logic.Section_X]-tagged Vitest suite passes on the Baseline Seed. - Output Certificate: issue a Harness Pass Certificate in the task log if all gates pass.
3. Documentation-to-Test Mapping
Every core logic block in biz_logic.md cross-references a unit test in src/__tests__
(naming convention: [Ref: biz_logic.Section_2.1] in the suite description). A Harness Test
runs the standard Baseline Seed (SimulationState) and asserts output matches the Baseline
Result P&L snapshot defined in the docs.
4. Runtime Guardrails (Harnessing State)
- Zod enforcement: every input to
simulate()validated by Zod schemas mirroringerd.md. - Type-safe math:
mathjswrappers (precision.ts) against IEEE 754 drift. - Boundary guards: early returns or thrown errors for invalid states (e.g., mix ratio ≠ 1.0).
5. Agentic Verification Handover
- Submission:
core-engine-devsubmits code + Vitest report. - Audit:
cpa-auditorverifies assertions match the LaTeX formulas exactly. - Certification: Auditor issues the Harness Pass Certificate (PR body marker).
5.1. Precision Verification Checklist
- [ ]
mathjsused for non-integer calculations? - [ ] Test uses the Baseline Seed (§3)?
- [ ] Rounding (
Math.round) applied only at final-output stage in expectations?
5.2. Security Audit Checklist (with security-auditor)
- [ ] No secrets leakage:
.envignored; no hardcoded keys/tokens. - [ ] Data sanitization: inputs Zod-validated; Prisma only, no raw SQL.
- [ ] Access control: Server Actions validate ownership via
getUserId()/auth(). - [ ] Asset integrity:
prisma/dev.dbtracked correctly, not corrupted.
6. Spec Self-Healing & Drift Management
On logic drift (code ≠ spec):
- Spec first: update
biz_logic.mdwith the corrected LaTeX formula. - Harness update: modify the test suite to match the new formula.
- Implementation: adjust engine code until the updated harness passes.
- Audit: reconvene the Strategic Council for any change impacting BEP or Contribution Margin.
Output
Harness Pass Certificate block (gates passed, seed hash, tolerances) or a rejection list of
failing [Ref:] anchors.
Context
See docs/co-price.context.md for project context and the consulting engagement lifecycle.
When to Use
- When a co-price task requires 5-gate engine certification pipeline within the engagement lifecycle.
Execution Steps
- Receive dispatch from PM with task parameters and document anchors.
- Execute the skill procedure against the artifacts named in the task scope.
- Report results to the dispatching agent with evidence links.
Output Format
Structured markdown report delivered to the dispatching agent, citing document anchors (for example [Ref: biz_logic.*]) where applicable.
Related Skills
- Owner agent:
cpa-auditor. Seevariant.jsonskills registry for the full co-price skill set.
04 同仓库更多 Skills
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.