The validator, and what a pass means
Conformance means meeting the OpenGDD specification's requirements. OpenGDD's validator checks the requirements that a program can check in a package. A package is one folder that contains a game's design. A person reviews the written design.
Run the checks
The validator runs inside OpenGDD's authoring tool as you write. You do not need to install anything.
Run the validator from the command line
With Node.js installed, replace <package-dir> with
the path to the package folder:
npx opengdd validate <package-dir>
For an automated check, pin this release:
npx opengdd@0.9 validate <package-dir>.
To check a build record, name the record and, if you have it, the package
it was built from. --render-contract-tests prints the tests that
the package's checked contract adoptions imply, as Markdown, without
changing any file.
npx opengdd validate --build <opengdd-build.json> [<package-dir>]
npx opengdd validate --render-contract-tests <package-dir>
Exit codes
For a package check:
0: the report has no errors. Warnings, hints, and safety notices never fail a run.1: the report has one or more conformance errors.2: the command has a usage error, such as an unknown option or a missing argument.
For a build-record check, 0 means conforming. No other outcome
exits with 0. 1 means invalid, 2 means a command usage error, and
3 means incomplete, not verified, or not checked because no
package was supplied.
JSON report
validate --json writes one JSON object to standard output for
both passing and failing validation runs. It has these fields:
validatornames the validation kind;formatis the OpenGDD version checked, currently"0.9"; andvalidator_versionis the npm package version that produced the report.package, orbuildin build-record mode, containsidandpath. A package id isnullwhen the package directory could not be read.validis a Boolean, with one exception. It isnullwhen a build record was checked without its package and has no errors of its own. A build record with errors hasvalidset tofalse, also when it was checked without its package. Package verdicts arePASS,PASS WITH WARNINGS, orFAIL. A build verdict isPASSorPASS WITH WARNINGSonly when the outcome is conforming. Otherwise the build verdict isINCOMPLETE,NOT VERIFIED,NOT CHECKED, orFAIL.- In build-record mode,
outcomeisconforming,incomplete,not verified,invalid, ornot checked. summarycontains the numeric countserrors,dependent,warnings,hints,safety, andfindings.findingsis an array. Every finding hascode,severity,spec_section,file, andmessage.lineand check-specificdataappear when known.dependent: trueappears on an error that is waiting for required designer input.hintsandsafetyare separate arrays with the same location and message fields. All three arrays are present even when empty. Hints appear only when--reviewis requested; the safety scan runs by default. Neither array changes the verdict or warning count.
validate --review <package-dir> asks for optional review
hints. The hint checks work only on English text. Three checks of the safety
scan also read only English, so these checks do not find a hostile
instruction in another language. A scan with no findings does not prove that
a package is safe.
The source code of these checks is in the specification repository. It
needs only Node.js and no other software. Every finding has a stable code,
such as PROSE_CITATION_DANGLING. This code names the rule. The
finding also names the specification section of that rule.
What the validator checks
The validator checks the files of the package and the connections between them:
- Required files and fields are present.
- References in the writing point to defined names.
- Numbers fall within their declared limits and satisfy the rules in
tuning.json. - Data files follow their required structure.
- Acceptance tests, the checks a finished game must pass, contain the required information.
More detail by part of the package
- the package: required files present, every declared path inside the package, the manifest valid against its schema;
- the fantasy block: at least one fantasy line, no more
than 280 characters across the lines, three to five
feel entries, and a non-empty
NOT:line; - values: finite shared numbers under declared keys;
- ranges: inclusive limits that contain their current values;
- rules: one comparison between two calculations, with resolvable keys and finite results;
- personalization: question and answer shapes. Every
setsentry targets a rangedvaluesnumber or an open number, and stays inside the range when the number has one. A record field or a contract value is never a target; - collections: collection and record ids are well formed, every record is checked against its schema where one is declared, and every cited collection or record exists;
- links: linked records exist, forbidden loops are absent, and declared back-pointers agree in both directions;
- runtime values: each address in the
unchanged.valueslist of a test has a declaration in a chapter or a clock; - clocks: every clock covers every time mode with one of the four behavior words, and supports any test claim that named runtime values stay unchanged;
- acceptance tests: ordered headings, one structured
testblock per heading, and the fields that block requires; - art direction: palette and direction shape, dotted references, coverage of every measured promise, and declared WCAG 2.1 contrast floors;
- contracts: the answers, numbers, rows and rules of each adoption agree with its contract, and the acceptance tests stored with the adoption match that contract.
Zero errors means the package passed the validator's checks. A warning marks something to read again. A warning does not fail validation. Passing validation does not prove that the design is good, or that a finished game follows it.
Build records
The builder is the person, team or AI that turns the
package into a game. A build record is the builder's report
of that game, stored in opengdd-build.json. It identifies the
package, the choices made for that build, the final numbers and the test
results.
If you also have the package, the validator checks that the record agrees
with it. The final numbers include the builder's choices for ranged and open
numbers. The test counts must add up, and every test that did not pass must be
listed with failed, partial, or not-run
and a reason. These checks read the record. They do not run the game or prove
that the record is true.
The validator reports conforming only when the package has
tests and all of them passed. A record that correctly lists the tests that
did not pass is incomplete. A record for a package with no tests
is not verified. Tests the builder added for their own process do
not change these outcomes.
A record that has errors is invalid, also when it is checked
without its package. Without its package, a record that has no errors of its
own is not checked, because the package-dependent checks did not
run. From the record alone, the validator still checks the acceptance sum:
the number of passed tests plus the number of tests listed as not passed
must equal the total.
The exit codes and the JSON verdicts for a build record are listed above, in the command-line part of the section Run the checks.
Auditing a build
An audit examines a finished game and its evidence to check whether it follows the package. OpenGDD's experimental certification protocol describes the process:
- Check the package. Run the validator and have a person review the applicable requirements in the writing.
- Build and test the game. The builder follows the design, runs every acceptance test the package declares and records the results.
- Review the game and evidence. A separate auditor checks whether the tests measure the intended behavior. They also check that the game uses the declared numbers and follows the design.
- Verify the report. The auditor checks identities, choices, test results and file hashes. A hash identifies the exact evidence file. The audit records its findings and the limits of the checks made.
The protocol defines experimental verdicts: certify, certify with notes, or do not certify. These are research outcomes. There is no official OpenGDD certification program. These verdicts grant no certification mark.
Limits of the checks
- Taste. An audit asks whether a build follows its package. It does not decide whether the game is enjoyable. Builds may differ where the designer leaves choices open.
- Audio. A package may describe audio in prose, but the current format has no checking rules for audio direction.
- What a player feels or knows. The format can test what is on screen and in the game's state. Those observations do not prove a player's feelings or understanding. The known limitations page explains this limit.