Skip to content

moonc syncheck: support moon.work (currently rejected as unsupported input) #1859

Description

@bobzhang

Summary

moonc syncheck accepts .mbt, .mbt.md, moon.pkg, and moon.mod, but not moon.work. Running it against a moon.work file fails outright rather than syntax-checking it:

$ moonc syncheck -error-format json moon.work
moon.work: unsupported input file type for syncheck; supported suffixes: .mbt, .mbt.md, moon.pkg, moon.mod
$ echo $?
2

moon.work.json is likewise rejected.

Environment

$ moonc -v
moonc v0.10.3+0225ff0ff-nightly (2026-07-03)

(Feature flags: rr_moon_mod,rr_moon_pkg)

Why it matters

We use moonc syncheck as a standalone, project-less pre-write syntax gate for agent-authored edits — it validates candidate file content in a scratch file before it lands on disk, with no build lock or project context. It already covers .mbt, .mbt.md, moon.mod, and moon.pkg. moon.work is the one workspace file we cannot gate this way, so a malformed moon.work can be written unchecked.

Request

Add moon.work (and, if applicable, its textual form) to the set of moonc syncheck inputs, parsing it with the same workspace-file grammar moon uses, and emitting the same JSON lex/parse diagnostics as the other kinds.

Repro

printf 'members = [ "a",\n' > moon.work   # unterminated
moonc syncheck -error-format json moon.work
# expected: a lex/parse diagnostic; actual: "unsupported input file type"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions