; cn_cmd tests (ppx_expect) — pure functions from command modules
(library
 (name cn_cmd_test)
 (modules cn_cmd_test)
 (libraries cn_cmd cn_ffi cn_lib cn_protocol)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_dotenv tests (ppx_expect) — dotenv parser + filesystem
(library
 (name cn_dotenv_test)
 (modules cn_dotenv_test)
 (libraries cn_cmd cn_ffi unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_shell tests (ppx_expect) — CN Shell types + ops parser
(library
 (name cn_shell_test)
 (modules cn_shell_test)
 (libraries cn_cmd cn_lib)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_sandbox tests (ppx_expect) — path sandbox + symlink attacks
(library
 (name cn_sandbox_test)
 (modules cn_sandbox_test)
 (libraries cn_cmd unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_executor tests (ppx_expect) — typed op executor
(library
 (name cn_executor_test)
 (modules cn_executor_test)
 (libraries cn_cmd cn_ffi cn_lib unix str)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_orchestrator tests (ppx_expect) — N-pass orchestration
(library
 (name cn_orchestrator_test)
 (modules cn_orchestrator_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_projection tests (ppx_expect) — projection idempotency markers
(library
 (name cn_projection_test)
 (modules cn_projection_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_capabilities tests (ppx_expect) — capability discovery block
(library
 (name cn_capabilities_test)
 (modules cn_capabilities_test)
 (libraries cn_cmd cn_lib)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_trace tests (ppx_expect) — event schema + JSONL writer + integration
(library
 (name cn_trace_test)
 (modules cn_trace_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_trace_state tests (ppx_expect) — state projection writers + integration
(library
 (name cn_trace_state_test)
 (modules cn_trace_state_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_build tests (ppx_expect) — package assembly from src/agent/
(library
 (name cn_build_test)
 (modules cn_build_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_output tests (ppx_expect) — output plane separation
(library
 (name cn_output_test)
 (modules cn_output_test)
 (libraries cn_cmd cn_lib)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_contract tests (ppx_expect) — protocol contract consistency (I2)
(library
 (name cn_contract_test)
 (modules cn_contract_test)
 (libraries cn_cmd cn_ffi cn_lib cn_protocol)
 (inline_tests
  (deps protocol-contract.json))
 (preprocess (pps ppx_expect)))

; cn_traceability tests (ppx_expect) — readiness projection smoke (I3)
(library
 (name cn_traceability_test)
 (modules cn_traceability_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests
  (deps protocol-contract.json))
 (preprocess (pps ppx_expect)))

; cn_runtime integration tests (ppx_expect) — N-pass wiring (Issue #41)
(library
 (name cn_runtime_integration_test)
 (modules cn_runtime_integration_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_runtime_contract tests (ppx_expect) — wake-up self-model (Issue #56)
(library
 (name cn_runtime_contract_test)
 (modules cn_runtime_contract_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_boot_banner tests (ppx_expect) — daemon boot config declaration (Issue #61)
(library
 (name cn_boot_banner_test)
 (modules cn_boot_banner_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_stale_history tests (ppx_expect) — stale conversation history (Issue #63)
(library
 (name cn_stale_history_test)
 (modules cn_stale_history_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_deps tests (ppx_expect) — package restore + lockfile + integrity (Issue #113)
(library
 (name cn_deps_test)
 (modules cn_deps_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_command tests (ppx_expect) — command discovery, dispatch, validation
(library
 (name cn_command_test)
 (modules cn_command_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_activation tests (ppx_expect) — frontmatter parser, activation index, doctor checks
(library
 (name cn_activation_test)
 (modules cn_activation_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_workflow tests (ppx_expect) — orchestrator IR parser, validator, discovery, executor
(library
 (name cn_workflow_test)
 (modules cn_workflow_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_extension tests (ppx_expect) — extension manifest, registry, dispatch (Issue #73)
(library
 (name cn_extension_test)
 (modules cn_extension_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests
  (deps ../../src/agent/extensions/cnos.net.http/host/cnos-ext-http))
 (preprocess (pps ppx_expect)))

; cn_ulog tests (ppx_expect) — unified operator log (#74)
(library
 (name cn_ulog_test)
 (modules cn_ulog_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_logs tests (ppx_expect) — cn logs CLI (#74)
(library
 (name cn_logs_test)
 (modules cn_logs_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_selfpath tests (ppx_expect) — hardcoded path removal (#146)
(library
 (name cn_selfpath_test)
 (modules cn_selfpath_test)
 (libraries cn_cmd cn_ffi cn_lib unix)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_mail tests (ppx_expect) — mail transport invariants
(library
 (name cn_mail_test)
 (modules cn_mail_test)
 (libraries cn_lib)
 (inline_tests)
 (preprocess (pps ppx_expect)))

; cn_placement tests (ppx_expect) — hub placement manifest parsing (#156)
(library
 (name cn_placement_test)
 (modules cn_placement_test)
 (libraries cn_cmd cn_lib)
 (inline_tests)
 (preprocess (pps ppx_expect)))
