Codebase healthPhase 1 — Documentation & setup
Behavioral spec: op_picker
Status: Partially implemented — spec published; the console op-picker //! module doc does not yet link to it
Current shape
The active console 1Password picker adapter is crates/jackin-console/src/tui/op_picker.rs. Picker metadata types (RawOpField, RawOpItemDetail, and the From conversions into jackin_core::op_types) live in crates/jackin-env/src/picker.rs; the OpStructRunner trait lives in crates/jackin-env/src/op_struct.rs and is consumed by env resolution in crates/jackin-env/src/resolve.rs. The surface-local render/state-plan component lives in crates/jackin-console/src/tui/components/op_picker.rs.
The old op_picker/mod.rs path is obsolete. The remaining task is documentation linkage, not another split.
Key invariants
| INV | Description | Verify by |
|---|---|---|
| INV-1 | Field selection commits OpField::reference verbatim when present; only fixtures missing reference use the synthesized op://<vault>/<item>/<label> fallback | selection path returns field.reference.clone() first, then falls back to format!("op://{}/{}/{}"...) |
| INV-2 | No secret values in picker path — RawOpField has no value field; serde drops it silently | grep picker structs for value; use exhaustive destructure tests around RawOpField |
| INV-3 | Loading is async; key handlers stay synchronous and only advance UI state / poll pending results | background loaders send through channels; key handlers do not call the op CLI directly |
| INV-4 | Field-list selection indexes the display row list, not the filtered field slice directly. Section-header rows are navigable and selectable; Enter on a header toggles collapse rather than committing a field | display rows use a FieldDisplayRow-style layer; collapse/expand and Up/Down operate on display-row length |
Remaining work
- Add a link to op_picker Behavioral Spec in the
//!module doc at the top ofcrates/jackin-console/src/tui/op_picker.rs; keep implementation details in the reference spec, not duplicated in the module doc.
Related files
crates/jackin-console/src/tui/op_picker.rs— console adapter for state, loader, key handling, and commit selectioncrates/jackin-console/src/tui/components/op_picker.rs— surface-local op-picker render/state-plan helpers including collapsible section headerscrates/jackin-env/src/picker.rs—RawOpFieldand other picker metadata types, plusFromconversions intojackin_core::op_typescrates/jackin-env/src/op_struct.rs—OpStructRunnertraitcrates/jackin-env/src/resolve.rs— env resolution consumingOpStructRunner