@jasonbelmonti/markdown-engine 3.8.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -2
- package/README.md +37 -28
- package/SECURITY.md +6 -4
- package/dist/cli/validate-args.d.ts +1 -1
- package/dist/cli/validate-args.d.ts.map +1 -1
- package/dist/cli/validate-args.js +8 -7
- package/dist/cli/validate-args.js.map +1 -1
- package/dist/cli/validation-output.d.ts.map +1 -1
- package/dist/cli/validation-output.js +7 -6
- package/dist/cli/validation-output.js.map +1 -1
- package/dist/cli/validation-report-cache.d.ts +3 -0
- package/dist/cli/validation-report-cache.d.ts.map +1 -0
- package/dist/cli/validation-report-cache.js +41 -0
- package/dist/cli/validation-report-cache.js.map +1 -0
- package/dist/internal/package-version.d.ts +1 -1
- package/dist/internal/package-version.js +1 -1
- package/dist-bundled/markdown-engine-cli.mjs +322 -286
- package/docs/contracts/declarative-validation.md +31 -13
- package/package.json +1 -1
- package/scripts/install-markdown-engine-cli.sh +2 -2
- package/skills/profile-backed-markdown/SKILL.md +3 -1
|
@@ -809,7 +809,7 @@ The CLI reads and checks the profile before reading the Markdown file. Profile
|
|
|
809
809
|
parse, config, and compile failures emit profile-stage JSON and do not parse or
|
|
810
810
|
validate the Markdown file.
|
|
811
811
|
|
|
812
|
-
|
|
812
|
+
With `--output full`, after profile compilation succeeds the CLI emits a validation-result JSON
|
|
813
813
|
shape whether the document passes or fails. Validation CLI results include
|
|
814
814
|
evidence. V2 CLI results use the same validation-result arm of the CLI JSON
|
|
815
815
|
union; there is no extra CLI discriminator beyond
|
|
@@ -817,7 +817,7 @@ union; there is no extra CLI discriminator beyond
|
|
|
817
817
|
|
|
818
818
|
## CLI JSON Union
|
|
819
819
|
|
|
820
|
-
The
|
|
820
|
+
The explicit `--output full` CLI JSON output is:
|
|
821
821
|
|
|
822
822
|
```ts
|
|
823
823
|
type DeclarativeValidationCliJsonResult =
|
|
@@ -847,12 +847,13 @@ profiles, that same validation-result JSON can include `evaluatedRuleCount`,
|
|
|
847
847
|
|
|
848
848
|
## Compact Validation Output
|
|
849
849
|
|
|
850
|
-
`--output
|
|
851
|
-
|
|
852
|
-
|
|
850
|
+
The default `--output summary` emits the CLI-only
|
|
851
|
+
`schemaVersion: "markdown-engine.validation-summary.v1"` representation and saves
|
|
852
|
+
a complete report automatically. `--output full` preserves the earlier full JSON
|
|
853
|
+
contract and serialization without creating an automatic report.
|
|
853
854
|
Both modes still use `--format json`. Each new selector accepts spaced or
|
|
854
855
|
assignment syntax and may occur only once. Missing/blank paths, unsupported
|
|
855
|
-
output modes
|
|
856
|
+
output modes are usage errors (exit 2). Summary mode does not require a report path.
|
|
856
857
|
These options do not apply to the normalization command.
|
|
857
858
|
|
|
858
859
|
Summary fields:
|
|
@@ -879,27 +880,43 @@ in the report. Counts exclude nested skipped-applicability and branch details,
|
|
|
879
880
|
which remain in the complete result. A passing verdict can contain warnings;
|
|
880
881
|
summary presentation neither discards those warnings nor changes the exit code.
|
|
881
882
|
|
|
882
|
-
The full report is byte-identical to
|
|
883
|
+
The full report is byte-identical to `--output full` stdout for the same invocation's
|
|
883
884
|
validation result: stable pretty JSON followed by one newline. Its raw-file
|
|
884
885
|
SHA-256 is distinct from normalized `evidence.inputHash` and `profileHash`.
|
|
885
|
-
Summary stdout
|
|
886
|
-
result arrays.
|
|
886
|
+
Summary stdout has stable JSON key ordering and one final newline, with no rule
|
|
887
|
+
result arrays. Automatic report paths are unique, so summary bytes vary between
|
|
888
|
+
invocations; full results and evidence remain deterministic. These presentation fields are not additions to the engine's
|
|
887
889
|
public API result types or evidence hashes.
|
|
888
890
|
|
|
889
|
-
|
|
891
|
+
Automatic reports use unique `report-<UUID>.json` filenames under
|
|
892
|
+
`$XDG_CACHE_HOME/markdown-engine/validation-reports` when that environment value
|
|
893
|
+
is absolute, otherwise `~/.cache/markdown-engine/validation-reports`. Missing
|
|
894
|
+
cache directories are created with mode 0700, and report files with mode 0600
|
|
895
|
+
(subject to platform support and the process umask). Automatic writes best-effort
|
|
896
|
+
prune regular generated-name reports whose modification time is older than seven
|
|
897
|
+
days; recent files, unrelated names, directories and symlinks are left alone.
|
|
898
|
+
Pruning errors do not change the verdict after successful report publication.
|
|
899
|
+
Cleanup runs only on automatic writes and is not a disk quota or retention
|
|
900
|
+
guarantee; external cache cleanup may remove files sooner. Reserve this cache for
|
|
901
|
+
disposable reports and use an explicit path outside it for durable evidence.
|
|
902
|
+
|
|
903
|
+
`--report-file` overrides automatic storage and is also permitted with full output.
|
|
904
|
+
Explicit writes do not run cache cleanup. Relative destinations resolve
|
|
890
905
|
against the invocation's current working directory. The parent directory must
|
|
891
906
|
exist; the destination must not exist. Report publication stages a complete file
|
|
892
907
|
in that directory, then publishes it with an exclusive hard link and removes
|
|
893
908
|
the temporary file. Existing files, directories, symlinks and hard links are
|
|
894
909
|
never replaced. Filesystems that do not support this operation report an I/O
|
|
895
910
|
error. Report bytes are written before any validation JSON is emitted to stdout.
|
|
911
|
+
`--output full` without `--report-file` performs no report/cache filesystem work.
|
|
896
912
|
|
|
897
913
|
A report-publication failure overrides a 0/1 validation status with exit 2,
|
|
898
914
|
emits a stderr error, and emits no validation JSON to stdout. Usage or input-read
|
|
899
915
|
failures continue to use the existing stderr contract and do not create a report.
|
|
900
|
-
Profile-stage validation failures
|
|
916
|
+
Profile-stage validation failures create an automatic report in summary mode or
|
|
917
|
+
an explicit report when requested, retain
|
|
901
918
|
exit 1, and omit unavailable evidence identities from the summary. The report
|
|
902
|
-
writer
|
|
919
|
+
writer and automatic cache are narrow CLI filesystem-output boundaries; the validator/API do not gain
|
|
903
920
|
persistence or filesystem-write behavior.
|
|
904
921
|
|
|
905
922
|
## Exit Codes
|
|
@@ -1261,7 +1278,8 @@ recursive grouped rules, branch-level `when`, profile-defined predicates,
|
|
|
1261
1278
|
assertion-specific evidence payloads, a separate skipped-rule evidence channel,
|
|
1262
1279
|
and a new CLI JSON discriminator.
|
|
1263
1280
|
|
|
1264
|
-
The CLI reads
|
|
1281
|
+
The CLI reads caller-specified local Markdown and profile files and manages its
|
|
1282
|
+
documented automatic-report cache. The
|
|
1265
1283
|
API owns no file traversal, daemon, database, browser runtime, network service,
|
|
1266
1284
|
agent adapter, MCP transport, runtime lens, or persistent cache.
|
|
1267
1285
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env sh
|
|
2
2
|
set -eu
|
|
3
3
|
|
|
4
|
-
VERSION="
|
|
4
|
+
VERSION="4.0.0"
|
|
5
5
|
PACKAGE="@jasonbelmonti/markdown-engine"
|
|
6
|
-
EXPECTED_SHA256="
|
|
6
|
+
EXPECTED_SHA256="afc4dfe3846f30f1e8ad70d77e818bd3bcfc9d62ef844a857c523ebaf758c97f"
|
|
7
7
|
DEFAULT_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|
8
8
|
MARKDOWN_ENGINE_HOME="${MARKDOWN_ENGINE_HOME:-$DEFAULT_DATA_HOME/markdown-engine}"
|
|
9
9
|
MARKDOWN_ENGINE_BIN_DIR="${MARKDOWN_ENGINE_BIN_DIR:-$HOME/.local/bin}"
|
|
@@ -18,7 +18,9 @@ node scripts/validate-profile-backed-markdown.mjs --file /path/to/file.md
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
2. Treat stdout as the validator JSON source of truth. Do not infer pass/fail
|
|
21
|
-
from prose or repair notes.
|
|
21
|
+
from prose or repair notes. Compact output includes total diagnostic counts
|
|
22
|
+
and a full-report path; inspect that report only when omitted details matter.
|
|
23
|
+
Automatic reports are cached for seven days and may be removed by later runs.
|
|
22
24
|
3. If validation fails, rerun with `--repair-brief` to emit compact repair
|
|
23
25
|
guidance on stderr while preserving validator JSON on stdout.
|
|
24
26
|
4. Edit the Markdown file only when the user asked for repair. Do not edit
|