KeiSeiKit-1.0/_primitives/_rust/kei-task/src
Parfii-bot 8626e23c22 feat(stream-e): invoke wire — kei-runtime subprocess → real atoms
Replace NotImplemented stub with real atom execution per schema
§Runtime invocation contract.

Convention: JSON-in/JSON-out over subprocess. Every refactored crate
exposes `<crate> run-atom <verb>` that reads JSON from stdin (or
--input), dispatches to atoms::<verb>::run, emits Output JSON on
stdout, exits per atom-error class.

Runtime side (kei-runtime):
- InvokeError: +AtomFailed{atom,code,stderr} +SubprocessError
  +OutputParse +BinaryNotFound{crate_name}. NotImplemented kept as
  legacy escape for atoms opting out of run-atom protocol.
- Output: now {atom: String, result: Value} — carries atom's actual
  return value.
- invoke_exit_code: AtomFailed passes through child exit (0..=255),
  Subprocess/OutputParse → 1, BinaryNotFound → 127, NotImplemented → 64.
- Binary resolution: KEI_RUNTIME_BIN_DIR env → PATH fallback.

kei-task side:
- New `pub mod run_atom` in lib.rs
- atoms/mod.rs: VERBS const + DispatchError enum wrapping per-atom errors
- src/run_atom.rs: read_input (stdin/@path/literal), dispatch, exit mapping
- main.rs: Cmd::RunAtom{verb, input} subcommand; collapsed three
  classify_*_error helpers into single classify_dispatch. Legacy
  create/search/add-dependency CLIs preserved.

Tests: 5/5 runtime (+1 invoke_real_atom integration), 9/9 kei-task
(+1 atoms::tests::verbs_list_matches_submodules).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 01:21:00 +08:00
..
atoms feat(stream-e): invoke wire — kei-runtime subprocess → real atoms 2026-04-23 01:21:00 +08:00
deps.rs feat(primitives): 10 Rust crates extracted from LBM (Genesis-scrubbed) 2026-04-22 12:48:56 +08:00
graph.rs feat(primitives): 10 Rust crates extracted from LBM (Genesis-scrubbed) 2026-04-22 12:48:56 +08:00
lib.rs feat(stream-e): invoke wire — kei-runtime subprocess → real atoms 2026-04-23 01:21:00 +08:00
main.rs feat(stream-e): invoke wire — kei-runtime subprocess → real atoms 2026-04-23 01:21:00 +08:00
milestones.rs feat(primitives): 10 Rust crates extracted from LBM (Genesis-scrubbed) 2026-04-22 12:48:56 +08:00
run_atom.rs feat(stream-e): invoke wire — kei-runtime subprocess → real atoms 2026-04-23 01:21:00 +08:00
schema.rs chore(rust): misc schema/main refactor in 8 crates (assorted CP splits) 2026-04-22 13:36:17 +08:00
search.rs feat(primitives): 10 Rust crates extracted from LBM (Genesis-scrubbed) 2026-04-22 12:48:56 +08:00
store.rs feat(primitives): 10 Rust crates extracted from LBM (Genesis-scrubbed) 2026-04-22 12:48:56 +08:00
types.rs feat(primitives): 10 Rust crates extracted from LBM (Genesis-scrubbed) 2026-04-22 12:48:56 +08:00