Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

validate: --strict --json exits 3 while the payload reports "valid": true

Closed Beginner friendly
#304 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
nodejs, typescript
Domain
cli

Research direction

The bug is in src/cli/validate.ts around lines 227-230, where the formatJson payload is printed before process.exitCode is set. valid is computed from the error count alone, while the exit code also counts warnings under --strict. Start by reading that block and the sibling fix referenced in #283. Done means --strict --json either reports valid: false when it exits 3, or includes explicit strict and gated_by_warnings fields. Choosing between those two options is part of the work, so check with the maintainer first.

Written by the indexing model from the issue text.

Description

bug core priority: medium tests

Summary

With --strict and --json, warnings gate the exit code but are not reflected in the JSON, so a machine caller reads valid: true from a failed run.

Repro

Vault containing one note with malformed frontmatter (1 warning, 0 errors):

command exit payload
validate 0 —
validate --strict 3 —
validate --json 0 {"valid":true,…,"error_count":0,"warning_count":1}
validate --strict --json 3 {"valid":true,…,"warning_count":1}

Expected

Under --strict, valid must be false when the exit code says validation failed — or the field should be accompanied by an explicit strict and gated_by_warnings so a script can tell the two apart.

Where

src/cli/validate.ts:227-230 prints the formatJson payload and then sets process.exitCode = ExitCode.Validation when errorCount > 0 || (options.strict && warningCount > 0). The valid field is computed from the error count only.

Related

#269 records a fixed sibling of this class — "an unknown depends_on_source label … so validate --json said valid: true" (fixed in #283). Same contract, different trigger.

Environment
  • palee 0.6.0, local build from main at 02dacd0 (installed as palee-test; reproduce with palee)
  • Node v24.19.0, Windows 11 x64, Git Bash
  • Vault: MIT-licensed Microsoft/OSSU curriculum markdown, 21-187 notes per vault
  • Every command below was run for real; exit codes captured by command substitution (never $? after a pipe)
Dominant language
TypeScript
Stars
1
Forks
0
Avg merge
21h 20m
Merged PRs (30d)
176

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Kuldeep2822k/cli

All issues in Kuldeep2822k/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.