validate: --strict --json exits 3 while the payload reports "valid": true
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
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
mainat02dacd0(installed aspalee-test; reproduce withpalee) - 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Kuldeep2822k/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Kuldeep2822k/cli#550 ·
Maintainers usually reply within 1 day
-
bug core priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Kuldeep2822k/cli#547 ·
Maintainers usually reply within 1 day
-
bug cli priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Kuldeep2822k/cli#546 ·
Maintainers usually reply within 1 day
-
bug priority: medium security
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Kuldeep2822k/cli#544 ·
Maintainers usually reply within 1 day
-
bug priority: medium storage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kuldeep2822k/cli#543 ·
Maintainers usually reply within 1 day
All issues in Kuldeep2822k/cli
Similar issues
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
0️⃣ phase/new
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
microsoft/playwright#43640 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100