NAME
Langertha::Holmgang::Lint - The self-check every case passes on every load
VERSION
version 0.001
SYNOPSIS
my $lint = Langertha::Holmgang::Lint->new( grader => $grader );
$lint->lint( $case, 'cases/c1.yaml' ); # 1, or a Langertha::Holmgang::Error
# with the two mock runs, as the loader's default lint has them
my $lint = Langertha::Holmgang::Lint->new(
mock_runs => Langertha::Holmgang::Runner->lint_mock_runs,
);
DESCRIPTION
A case checks itself (cai-platform docs/entwurf-evals.md §3.5) after the shape check, on every load from either front end:
- 0. Every argument filter (
{name|filter}) the world applies — in the path,value,at,fromandtoof a handler's change and in thewhenpaths of handlers and observations — is one format 2 knows (split,int,lc), whether or not a solution reaches it. - 1. Every output template of the suite's handlers and the case's observations renders against the initial state.
- 2. Doing nothing fails — except in the "no tool" family (
solution: []with the required ruleonly_tools: []), where doing nothing is the right answer. - 3. The reference solution and every alternative pass, none of their calls fails, and none hits a gap of the simulation.
- 4. Every wrong solution fails.
- 5. No
checkcommand hits a gap of the simulation after any of these paths (doing nothing, right ones, wrong ones).
That at least one required rule checks the end state is part of the shape check (Langertha::Holmgang::Structure). The two mock runs over a model engine — replaying the reference solution passes, twice identically; text only fails — need the runner; they come in as "mock_runs" ("lint_mock_runs" in Langertha::Holmgang::Runner, the loader's default).
A case that does not hold is a Langertha::Holmgang::Error with field and reason, and does not load. Fix the case or the simulator, never lint.
grader
The Langertha::Holmgang::Grader that replays the paths.
mock_runs
Optional code reference, called as $code->( $lint, $case, $field ) after the checks above pass. It runs the two mock runs and throws a Langertha::Holmgang::Error when one does not hold. Without it they do not run.
lint
$lint->lint( $case, $field );
Runs the checks above on a Langertha::Holmgang::Case. $field starts every refused field (default the case id). Returns 1.
SUPPORT
Issues
Please report bugs and feature requests at https://github.com/Getty/langertha-holmgang/issues.
IRC
Join #langertha on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <torsten@raudssus.de>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.