From 9ed680258e2c45fe541ac36bc4c8cea1c6120aca Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Mon, 14 Sep 2026 05:20:21 +0000 Subject: [PATCH] feat(xce-harness-component): promote ctrlstatus_fmt.h to shared xce/ include path Move the one genuinely shared header (header-only, static inline, zero link dependency) from src/controller/testsuite/ to src/include/xce/, alongside the existing cross-daemon shared headers (cluster.h, types.h, errnox.h). Repoint its three current consumers (harness's test.c and joblist_display.c, controller's test_ctrlstatus.c) to the new path. test_joblist_display.c is intentionally left on the old path -- it relocates in task 2.2. Also removes src/harness/meson.build's temporary '../controller/testsuite' incdir shim, which task 1.1 added and explicitly marked for removal once this task landed. controller_unit_test: 1228 Tests 0 Failures 0 Ignored (unchanged from task 1.1's baseline, confirming a header-path-only change). Task 1.2 of xce-harness-component. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC --- .kiro/specs/xce-harness-component/tasks.md | 2 +- src/controller/testsuite/test_ctrlstatus.c | 2 +- src/harness/joblist_display.c | 2 +- src/harness/meson.build | 11 +---------- src/harness/test.c | 2 +- .../testsuite => include/xce}/ctrlstatus_fmt.h | 0 6 files changed, 5 insertions(+), 14 deletions(-) rename src/{controller/testsuite => include/xce}/ctrlstatus_fmt.h (100%) diff --git a/.kiro/specs/xce-harness-component/tasks.md b/.kiro/specs/xce-harness-component/tasks.md index b4e45f14..19b7d51c 100644 --- a/.kiro/specs/xce-harness-component/tasks.md +++ b/.kiro/specs/xce-harness-component/tasks.md @@ -9,7 +9,7 @@ - The 11 removed test files' `.c` sources are left on disk at their current `src/controller/testsuite/` path for now (referenced by no build target) — task 2.1 physically relocates them together with `test_test_cli.c`/`test_xcetest_process_entry.c` - Observable: a harness-scoped build produces an `xce_test` binary; a controller-scoped build run immediately after this single task (no later tasks applied) still succeeds, `controller_unit_test`'s reported test count has dropped by exactly the 11 removed entries, and none of the four standalone binaries are defined anymore - _Requirements: 1.1, 1.2, 1.3, 2.1, 2.2, 2.4_ -- [ ] 1.2 Promote the shared ctrlstatus_fmt.h header and repoint its current consumers +- [x] 1.2 Promote the shared ctrlstatus_fmt.h header and repoint its current consumers - Move `ctrlstatus_fmt.h` to `src/include/xce/`; update the include path in harness's `test.c` and `joblist_display.c` (already relocated in 1.1) and in controller's `test_ctrlstatus.c` - `joblist_display.c`'s own test file, `test_joblist_display.c`, still lives in `src/controller/testsuite/` at this point and is intentionally left untouched here — its include-path fix happens in task 2.2, when that file relocates - Observable: a repo-wide search finds no remaining relative `#include "ctrlstatus_fmt.h"`; all three current consumers include it from `xce/ctrlstatus_fmt.h` diff --git a/src/controller/testsuite/test_ctrlstatus.c b/src/controller/testsuite/test_ctrlstatus.c index e739e4d4..f657a4ab 100644 --- a/src/controller/testsuite/test_ctrlstatus.c +++ b/src/controller/testsuite/test_ctrlstatus.c @@ -22,7 +22,7 @@ #include "persist.h" #include "xce/cluster_def.h" -#include "ctrlstatus_fmt.h" /* ctrlstatus_format_time_ms (task 6.3) */ +#include "xce/ctrlstatus_fmt.h" /* ctrlstatus_format_time_ms (task 6.3) */ /* ── helpers ────────────────────────────────────────────────── */ diff --git a/src/harness/joblist_display.c b/src/harness/joblist_display.c index 192bd4f4..c799115e 100644 --- a/src/harness/joblist_display.c +++ b/src/harness/joblist_display.c @@ -8,7 +8,7 @@ #include /* snprintf */ -#include "ctrlstatus_fmt.h" /* ctrlstatus_format_time_ms */ +#include "xce/ctrlstatus_fmt.h" /* ctrlstatus_format_time_ms */ #include "xce/types.h" /* XCE_WORKER_*, JOB_STAT_* bit definitions */ char* worker_status_str(uint32_t status) diff --git a/src/harness/meson.build b/src/harness/meson.build index de02a13c..3e0bf389 100644 --- a/src/harness/meson.build +++ b/src/harness/meson.build @@ -1,13 +1,4 @@ -# TEMPORARY (xce-harness-component task 1.1): '../controller/testsuite' is -# only here so the bare `#include "ctrlstatus_fmt.h"` in test.c/ -# joblist_display.c keeps resolving -- ctrlstatus_fmt.h itself still -# physically lives at src/controller/testsuite/ctrlstatus_fmt.h pending -# task 1.2, which promotes it to src/include/xce/ctrlstatus_fmt.h and -# repoints these two #include lines at it. Remove this entry when task 1.2 -# lands (it will make it redundant, since src/include is already on this -# path via '../include'). -incdir = include_directories('.', '../include', '../lib', 'include', - '../controller/testsuite') +incdir = include_directories('.', '../include', '../lib', 'include') zlib_dep = dependency('zlib') diff --git a/src/harness/test.c b/src/harness/test.c index 45a45195..505b5949 100644 --- a/src/harness/test.c +++ b/src/harness/test.c @@ -23,7 +23,7 @@ #include "client.h" #include "config.h" /* XCE_MAXNAME_LEN */ #include "controller.capnp.h" -#include "ctrlstatus_fmt.h" /* ctrlstatus_format_time_ms (task 6.3) */ +#include "xce/ctrlstatus_fmt.h" /* ctrlstatus_format_time_ms (task 6.3) */ #include "delay.h" #include "flagspec.h" /* shared flagspec_t descriptor-table flag parsing, * rejection (with typo suggestion), and help diff --git a/src/controller/testsuite/ctrlstatus_fmt.h b/src/include/xce/ctrlstatus_fmt.h similarity index 100% rename from src/controller/testsuite/ctrlstatus_fmt.h rename to src/include/xce/ctrlstatus_fmt.h