{"record":{"id":"0296423ccd4261f8","repo":"larksuite/cli","slug":"l1-meta-must-not-be-nil","errorCode":null,"errorMessage":"L1: _meta must not be nil","messagePattern":"L1: _meta must not be nil","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/schema/lint.go","lineNumber":54,"sourceCode":"\tif env.InputSchema == nil {\n\t\terrs = append(errs, errors.New(\"L1: inputSchema must not be nil\"))\n\t} else {\n\t\tif env.InputSchema.Type != \"object\" {\n\t\t\terrs = append(errs, fmt.Errorf(\"L1: inputSchema.type = %q, want \\\"object\\\"\", env.InputSchema.Type))\n\t\t}\n\t\tif env.InputSchema.Properties == nil {\n\t\t\terrs = append(errs, errors.New(\"L1: inputSchema.properties must not be nil\"))\n\t\t}\n\t}\n\tif env.OutputSchema == nil {\n\t\terrs = append(errs, errors.New(\"L1: outputSchema must not be nil\"))\n\t} else {\n\t\tif env.OutputSchema.Type != \"object\" {\n\t\t\terrs = append(errs, fmt.Errorf(\"L1: outputSchema.type = %q, want \\\"object\\\"\", env.OutputSchema.Type))\n\t\t}\n\t}\n\tif env.Meta == nil {\n\t\terrs = append(errs, errors.New(\"L1: _meta must not be nil\"))\n\t\t// Cannot continue meta-dependent checks\n\t\treturn errs\n\t}\n\tif env.Meta.EnvelopeVersion != \"1.0\" {\n\t\terrs = append(errs, fmt.Errorf(\"L1: _meta.envelope_version = %q, want \\\"1.0\\\"\", env.Meta.EnvelopeVersion))\n\t}\n\n\t// L1: validate every Property type recursively\n\tif env.InputSchema != nil && env.InputSchema.Properties != nil {\n\t\tvalidatePropertyTypes(env.InputSchema.Properties, &errs)\n\t}\n\tif env.OutputSchema != nil && env.OutputSchema.Properties != nil {\n\t\tvalidatePropertyTypes(env.OutputSchema.Properties, &errs)\n\t}\n\n\t// ---- L2: type-level consistency ----\n\tif env.InputSchema != nil && env.InputSchema.Properties != nil {\n\t\t// Walk the whole property tree so format/min-max checks reach leaf","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/schema/lint.go#L36-L72","documentation":"This L1 error means the envelope's Meta field is nil. Meta carries required metadata such as envelope_version and risk/access-token policy; without it the lint cannot continue, so it emits this error and returns immediately, skipping all meta-dependent checks (envelope_version, risk, access tokens).","triggerScenarios":"Linting an Envelope constructed without Meta, or with a zero-value Meta pointer; also triggered by decode paths that drop the _meta block.","commonSituations":"Hand-written envelopes omitting _meta; plugin authors copying struct literals without the meta block; deserialization where the \"_meta\" JSON key was absent so Meta decodes to nil.","solutions":["Set Meta to a value with EnvelopeVersion \"1.0\", a Risk level, and non-empty AccessTokens.","Copy the Meta block from a known-good envelope in the same registry and adjust risk/tokens.","Re-run the lint to surface any subsequent L1/L3 findings that were previously skipped by the early return."],"exampleFix":"// before\nenv := Envelope{Name: \"send.message\", InputSchema: in, OutputSchema: out}\n// after\nenv := Envelope{Name: \"send.message\", InputSchema: in, OutputSchema: out, Meta: &Meta{EnvelopeVersion: \"1.0\", Risk: core.RiskSafeRead, AccessTokens: []string{\"user\"}}}","handlingStrategy":"validation","validationCode":"func validateMeta(env *Envelope) error {\n    if env.Meta == nil {\n        return errors.New(\"envelope requires _meta with envelope_version, risk, access_tokens\")\n    }\n    return nil\n}","typeGuard":"if env.Meta == nil {\n    // handle: metadata missing; cannot run meta-dependent checks\n}","tryCatchPattern":"if err := lintEnvelope(env); err != nil {\n    // detect \"_meta must not be nil\" and populate Meta before retrying lint\n}","preventionTips":["Start every envelope from a template that includes Meta{EnvelopeVersion: \"1.0\"}.","Validate decoded envelopes' _meta presence after unmarshaling.","Note the lint returns early on nil Meta — fix this first so later L1/L3 errors become visible."],"tags":["go","schema","validation","envelope","metadata"],"backgroundTag":"schema-validation-failed","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}