Structured errors/warnings (with tips) in JSON output for agents
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- backend-api-design, cli
Research direction
Start by reading the --agent and --format json-full handling, getSerializedGraph, and the diagnostics and visibility rules used for config; the issue does not name their files. Trace how warnings, tips, and locations are produced, then decide how opt-in diagnostics preserve the existing json-full output and avoid exposing sensitive values. Done means the chosen output is documented and tested, including item filtering and the guides mentioned in the issue.
Written by the indexing model from the issue text.
Description
Agents reading varlock load output as JSON currently can't see warnings or the actionable tips attached to errors and warnings.
--format json-fullonly carries errors, aserrors.root(strings) anderrors.configItems(item key ->;-joined message string). No warnings, tips, or locations.--agent(redacted key/value map) has no place for problems at all.- The pretty stderr output has everything, but it's meant for humans.
The tips are often the most useful part for an agent (e.g. "mark it @sensitive=false, or add @type=string"), and a location tells it exactly which line to edit.
Constraints
- Plain
json-fullis consumed programmatically (framework integrations, and piped into__VARLOCK_ENVblobs in the sandbox guides), so it should stay lean and stable. We briefly added awarningsobject to it in #1156 and reverted that for this reason. getSerializedGraphalso produces the injected__VARLOCK_ENVblob viarun, so any additions there should be opt-in.
One possible shape
Gate a richer report on --agent, e.g. --agent --format json-full adds a flat diagnostics array:
{ "severity": "warning", "item": "FOO", "source": ".env.schema",
"message": "sensitive, but a number is never redacted",
"tip": "If it is not a secret, mark it `@sensitive=false`...",
"location": { "file": ".env.schema", "line": 3, "column": 1 } }
A flat list is easier for an agent to filter than nested joined strings. It should follow the same item visibility rules as config (no @internal / filtered-out / _VARLOCK_* items), and messages/tips must never contain sensitive values.
Open questions
- Behind
--agentonjson-full, a dedicated format, or something else (e.g. avarlock doctor/check --agentstyle command)? - Should
errorsin plainjson-fullstay as-is for back-compat even if agents get the richer form? - Include plugin warnings (currently only printed via
showPluginWarnings)? - Update
guides/ai-tools.mdxand the varlock skill to point agents at it.
- Dominant language
- TypeScript
- Stars
- 4.9k
- Forks
- 140
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 35
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 dmno-dev/varlock
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
dmno-dev/varlock#1279 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
dmno-dev/varlock#1100 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
dmno-dev/varlock#1278 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
dmno-dev/varlock#1275 · 1 comment ·
Maintainers usually reply within 1 day
-
core:varlock RFC
Difficulty 5/5 Over a week Newbie friendliness 28/100
dmno-dev/varlock#1258 · 1 comment ·
Maintainers usually reply within 1 day
All issues in dmno-dev/varlock
Similar issues
-
documentation good first issue roadmap
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
resend/react-email#3876 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
siyuan-note/siyuan#21324 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
himynameisdave/bsky-profanity-counter#59 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100