Skip to content

feat: add effectsSummary to graph JSON#49

Open
gke0op wants to merge 3 commits into
vercel-labs:mainfrom
gke0op:graph-effects-summary
Open

feat: add effectsSummary to graph JSON#49
gke0op wants to merge 3 commits into
vercel-labs:mainfrom
gke0op:graph-effects-summary

Conversation

@gke0op
Copy link
Copy Markdown

@gke0op gke0op commented May 17, 2026

Summary

Adds a normalized effectsSummary section to zero graph --json output,
providing a high-level view of capability requirements.

Shape

{
  "effectsSummary": {
    "required": ["world"],
    "availableOnTarget": ["args", "env", "fs", "memory", "time", "rand"],
    "missingOnTarget": ["world"]
  }
}
  • required: capabilities the program requires
  • availableOnTarget: capabilities the target supports
  • missingOnTarget: required capabilities not available on target

Why

Agents and editors can quickly assess portability without deep graph parsing.
Start with the narrow implementation (required, availableOnTarget, missingOnTarget)
as suggested in the issue.

Testing

  • All 9 CLI tests pass
  • All 8 docs tests pass
  • Command contracts pass
  • Verified with both host (darwin-arm64) and non-host (linux-musl-x64) targets

Closes #7

gke0op added 2 commits May 17, 2026 20:56
Adds --all flag to zero explain, emitting the full diagnostic catalog
as a structured JSON envelope. Text mode lists all codes with category
and title. Single-code explain is unchanged.

JSON envelope shape:
{
  "schemaVersion": 1,
  "command": "explain",
  "mode": "all",
  "count": 26,
  "diagnostics": [...]
}

Text mode:
  Diagnostic catalog (26 codes):
  TAR001  target   Unknown target
  ...

Also updates help text and allows explain to proceed without input
when --all is set.

Closes vercel-labs#2
Adds a normalized effectsSummary section to zero graph --json output,
providing a high-level view of capability requirements:

- required: capabilities the program requires
- availableOnTarget: capabilities the target supports
- missingOnTarget: required capabilities not available on target

This helps agents and editors quickly assess portability without
deep graph parsing. Start with the narrow implementation (required,
availableOnTarget, missingOnTarget) as suggested in the issue.

Closes vercel-labs#7
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

@gke0op is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread native/zero-c/src/main.c Outdated
gke0op added a commit to gke0op/zero that referenced this pull request May 17, 2026
The --all JSON path was using wrong repair IDs for several diagnostic
codes (ERR002, ERR003, STD003, CGEN004, etc.) and was missing entries
for TYP025, TYP026, PUB001, IFC001-005, STC001-003, SHM001-002,
RCV001-002. Now uses the exact same mapping as print_explain_json.

Fixes Vercel Agent Review finding on PR vercel-labs#49.
The --all JSON path was using wrong repair IDs for several diagnostic
codes (ERR002, ERR003, STD003, CGEN004, etc.) and was missing entries
for TYP025, TYP026, PUB001, IFC001-005, STC001-003, SHM001-002,
RCV001-002. Now uses the exact same mapping as print_explain_json.

Fixes Vercel Agent Review finding on PR vercel-labs#49.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize capability and effect summary in graph JSON

1 participant