{"record":{"id":"b799feded20c5869","repo":"multica-ai/multica","slug":"invalid-status-q-valid-values-s","errorCode":null,"errorMessage":"invalid status %q; valid values: %s","messagePattern":"invalid status %q; valid values: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_project.go","lineNumber":107,"sourceCode":"\tShort: \"Detach a resource from a project\",\n\tArgs:  exactArgs(2),\n\tRunE:  runProjectResourceRemove,\n}\n\nvar validProjectStatuses = []string{\n\t\"planned\", \"in_progress\", \"paused\", \"completed\", \"cancelled\",\n}\n\n// validateProjectStatus rejects unknown statuses client-side so a typo fails\n// fast with the valid list instead of a server round-trip and a 400. Shared by\n// `project create`, `project update`, and `project status`.\nfunc validateProjectStatus(status string) error {\n\tfor _, s := range validProjectStatuses {\n\t\tif s == status {\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn fmt.Errorf(\"invalid status %q; valid values: %s\", status, strings.Join(validProjectStatuses, \", \"))\n}\n\nfunc init() {\n\tprojectCmd.AddCommand(projectListCmd)\n\tprojectCmd.AddCommand(projectGetCmd)\n\tprojectCmd.AddCommand(projectCreateCmd)\n\tprojectCmd.AddCommand(projectUpdateCmd)\n\tprojectCmd.AddCommand(projectDeleteCmd)\n\tprojectCmd.AddCommand(projectStatusCmd)\n\tprojectCmd.AddCommand(projectResourceCmd)\n\n\tprojectResourceCmd.AddCommand(projectResourceListCmd)\n\tprojectResourceCmd.AddCommand(projectResourceAddCmd)\n\tprojectResourceCmd.AddCommand(projectResourceUpdateCmd)\n\tprojectResourceCmd.AddCommand(projectResourceRemoveCmd)\n\n\t// project list\n\tprojectListCmd.Flags().String(\"output\", \"table\", \"Output format: table or json\")","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_project.go#L89-L125","documentation":"Client-side validator validateProjectStatus (cmd_project.go:107): the status string passed to `project create`, `project update`, or `project status` is not one of validProjectStatuses (planned, in_progress, paused, completed, cancelled — plus the first entry of the slice visible above 'planned'). The check exists so typos fail immediately with the valid list instead of costing a server round-trip and a 400.","triggerScenarios":"Passing --status in-progress (hyphen instead of underscore), 'done', 'active', or any casing/spacing variant; passing an empty string where a status flag is required.","commonSituations":"Muscle memory from other tools (Jira uses different status vocabularies); scripts hardcoding statuses that were renamed; locale/case differences ('Active' vs 'active').","solutions":["Use one of the exact values the error prints: planned, in_progress, paused, completed, cancelled.","In scripts, source the list from one place (env var or a shared constants file) so renames cannot desync.","Tab-complete the flag or check `multica project create --help` for the accepted enum."],"exampleFix":"# before\nmultica project update p1 --status in-progress\n# invalid status \"in-progress\"; valid values: ...\n\n# after\nmultica project update p1 --status in_progress","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"planned\": true, \"in_progress\": true, \"paused\": true, \"completed\": true, \"cancelled\": true}\nif !valid[status] { return fmt.Errorf(\"invalid status %q\", status) }","typeGuard":"func isValidProjectStatus(s string) bool {\n    for _, v := range validProjectStatuses { if v == s { return true } }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Define statuses once in a shared constants file and import it in every script.","Use underscores, never hyphens, in multica status values.","Add a shell completion or CI lint that checks --status against the enum."],"tags":["cli","validation","enum","project","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}