{"record":{"id":"2d1e5f6d7ec22ba0","repo":"affaan-m/ECC","slug":"decisions-does-not-accept-a-session-id-when-all","errorCode":null,"errorMessage":"decisions does not accept a session ID when --all is set","messagePattern":"decisions does not accept a session ID when --all is set","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/main.rs","lineNumber":2143,"sourceCode":"            alternatives,\n            json,\n        }) => {\n            let resolved_id = resolve_session_id(&db, session_id.as_deref().unwrap_or(\"latest\"))?;\n            let entry = db.insert_decision(&resolved_id, &decision, &alternatives, &reasoning)?;\n            if json {\n                println!(\"{}\", serde_json::to_string_pretty(&entry)?);\n            } else {\n                println!(\"{}\", format_logged_decision_human(&entry));\n            }\n        }\n        Some(Commands::Decisions {\n            session_id,\n            all,\n            json,\n            limit,\n        }) => {\n            if all && session_id.is_some() {\n                return Err(anyhow::anyhow!(\n                    \"decisions does not accept a session ID when --all is set\"\n                ));\n            }\n            let entries = if all {\n                db.list_decisions(limit)?\n            } else {\n                let resolved_id =\n                    resolve_session_id(&db, session_id.as_deref().unwrap_or(\"latest\"))?;\n                db.list_decisions_for_session(&resolved_id, limit)?\n            };\n            if json {\n                println!(\"{}\", serde_json::to_string_pretty(&entries)?);\n            } else {\n                println!(\"{}\", format_decisions_human(&entries, all));\n            }\n        }\n        Some(Commands::Migrate { command }) => match command {\n            MigrationCommands::Audit { source, json } => {","sourceCodeStart":2125,"sourceCodeEnd":2161,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/main.rs#L2125-L2161","documentation":"The `decisions` subcommand lists decision log entries either across all sessions (`--all`, using `db.list_decisions`) or scoped to one session. Passing `--all` together with a session ID is rejected at parse/validation time with this error.","triggerScenarios":"Running `ecc2 decisions --all <session-id>` where `all && session_id.is_some()`.","commonSituations":"Adding `--all` to an existing per-session query to 'widen' it; automation templates that always include a session ID; misunderstanding the flag's semantics.","solutions":["Remove the session ID and keep `--all` to list decisions across sessions.","Remove `--all` and pass only the session ID to list that session's decisions.","Update scripts so the mode is chosen by presence/absence of the ID.","Consult `ecc2 decisions --help` for the two accepted forms."],"exampleFix":"// before (shell)\necc2 decisions --all sess-42\n\n// after\necc2 decisions --all        # all sessions\necc2 decisions sess-42      # one session","handlingStrategy":"validation","validationCode":"// shell: enforce exclusivity before listing decisions\nif $ALL_MODE && [ -n \"$SESSION_ID\" ]; then echo \"--all and a session ID are mutually exclusive\"; exit 1; fi","typeGuard":"fn decisions_args_ok(all: bool, session_id: &Option<String>) -> bool {\n    !(all && session_id.is_some())\n}","tryCatchPattern":"// catch validation failure at the script boundary\necc2 decisions \"$@\" || { echo \"decisions: bad argument combination\" >&2; exit 1; }","preventionTips":["Treat --all as a replacement for the session ID, not a modifier.","Write wrappers that select the mode from argument presence.","Keep examples in docs showing each form separately.","Test both invocation modes after CLI upgrades."],"tags":["cli","decisions","arguments","rust"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}