fix(harness): reset getopt_long via optind=0 to stop cross-command corruption
Every cmd_* REPL handler in test.c/join_worker_args.c reset flag parsing with `optind = 1;` only. glibc's getopt_long only fully reinitializes its internal scan state (nextchar/first_nonopt/last_nonopt) when optind==0, or on the process's very first getopt_long() call ever -- optind=1 alone leaves that state stale for every call after the first. Since xce_test's REPL dispatches many independent cmd_*() calls per process, a command whose parse ends on a short no-argument flag (`qctrl -a`, `hostctrl -o`) left state that corrupted the NEXT unrelated command's parse badly enough to misread its own name as an unrecognized flag. This was the actual cause of harness_unit_test's 4 deterministic (not flaky -- 20/20 identical repeat runs) test_test_cli.c failures, each burning its full 5s confirmation-prompt timeout. Fixed by using optind=0 at all 21 reset sites; confirmed via 3 isolated pty repros plus 10 consecutive clean harness_unit_test runs (132/132, was 4 failures/run every time). Also fixes a resource leak found while investigating: test_test_cli.c's spawned xce_test sessions were only torn down by inline clitest_kill_and_reap()/clitest_close() calls at the bottom of each test function, which Unity's longjmp-based TEST_ASSERT abort skips entirely on failure, leaking the child process and its pty/pipe fds. Added a static session mirror (safe across the longjmp, unlike a stack pointer) reaped from harness_test.c's tearDown(), which Unity guarantees runs after every test regardless of outcome. Logged as bug-1807/bug-1808 in .wolf/buglog.json, with the underlying getopt/longjmp gotchas recorded in .wolf/cerebrum.md. Full ASAN /xce-build harness also passes 5/5 with no sanitizer findings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
This commit is contained in:
parent
cbf822fc53
commit
868c6427c8
9 changed files with 672 additions and 74 deletions
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"version": 1,
|
||||
"meta": {
|
||||
"lastScanned": "2026-09-13T09:37:12.866Z",
|
||||
"fileCount": 532,
|
||||
"lastScanned": "2026-09-14T15:07:50.753Z",
|
||||
"fileCount": 559,
|
||||
"hits": 0,
|
||||
"misses": 0,
|
||||
"renderedHash": "1e5c212dfea7cd6b5ecc301cef1fa5432308875a98d00b7c0b3f556246533ee7",
|
||||
"storeUpdatedAt": "2026-09-13T09:37:12.874Z",
|
||||
"rootHash": "76dd78a99d8c45d4"
|
||||
"renderedHash": "fa0ccc6a5e22b9c3ea839f6af7edb6a4e2e0c854e5dbcfa8e3efa2923b5ff5da",
|
||||
"storeUpdatedAt": "2026-09-14T15:07:50.761Z",
|
||||
"rootHash": "2113d381173797cb"
|
||||
},
|
||||
"files": {
|
||||
".agent-shell/transcripts/2026-08-11-11-39-59.md": {
|
||||
|
|
@ -3767,13 +3767,12 @@
|
|||
},
|
||||
".kiro/steering/build-deployment.md": {
|
||||
"description": "Build & Deployment",
|
||||
"tokens": 2943,
|
||||
"hash": "b1b2a8ddaa1a76c5",
|
||||
"size": 11873,
|
||||
"mtimeMs": 1788488862888.3977,
|
||||
"updatedAt": "2026-09-08T03:09:38.923Z",
|
||||
"source": "scan",
|
||||
"importance": 0.1036
|
||||
"tokens": 3047,
|
||||
"hash": "2fd57469f0e3a81e",
|
||||
"size": 12293,
|
||||
"mtimeMs": 1789371733745.475,
|
||||
"updatedAt": "2026-09-14T07:42:13.788Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/steering/config-design.md": {
|
||||
"description": "Configuration Design: What Belongs in Shared Config",
|
||||
|
|
@ -3837,13 +3836,12 @@
|
|||
},
|
||||
".kiro/steering/roadmap.md": {
|
||||
"description": "Roadmap",
|
||||
"tokens": 15320,
|
||||
"hash": "5fdc4e8d0973de92",
|
||||
"size": 61740,
|
||||
"mtimeMs": 1787903021394.5676,
|
||||
"updatedAt": "2026-09-08T03:09:38.923Z",
|
||||
"source": "scan",
|
||||
"importance": 0.1036
|
||||
"tokens": 15650,
|
||||
"hash": "ae047b781c788d69",
|
||||
"size": 63068,
|
||||
"mtimeMs": 1789353566066.3699,
|
||||
"updatedAt": "2026-09-14T02:39:26.111Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/steering/scheduler-driver-equivalence.md": {
|
||||
"description": "Scheduler Driver Equivalence",
|
||||
|
|
@ -3867,13 +3865,12 @@
|
|||
},
|
||||
".kiro/steering/structure.md": {
|
||||
"description": "Project Structure",
|
||||
"tokens": 1374,
|
||||
"hash": "09812e9075bb59e8",
|
||||
"size": 5639,
|
||||
"mtimeMs": 1788444251209.7922,
|
||||
"updatedAt": "2026-09-08T03:09:38.924Z",
|
||||
"source": "scan",
|
||||
"importance": 0.1036
|
||||
"tokens": 1405,
|
||||
"hash": "a20a6eb11ff311ab",
|
||||
"size": 5771,
|
||||
"mtimeMs": 1789372082995.1614,
|
||||
"updatedAt": "2026-09-14T07:48:03.031Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/steering/tech.md": {
|
||||
"description": "Technology Stack",
|
||||
|
|
@ -3926,13 +3923,12 @@
|
|||
},
|
||||
"CLAUDE.md": {
|
||||
"description": "OpenWolf",
|
||||
"tokens": 1806,
|
||||
"hash": "d15c6898f8346461",
|
||||
"size": 7293,
|
||||
"mtimeMs": 1788444277292.7524,
|
||||
"updatedAt": "2026-09-08T03:09:38.924Z",
|
||||
"source": "scan",
|
||||
"importance": 0.1036
|
||||
"tokens": 1848,
|
||||
"hash": "425cd2bb8cb6fc54",
|
||||
"size": 7461,
|
||||
"mtimeMs": 1789371245842.9534,
|
||||
"updatedAt": "2026-09-14T07:34:05.884Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"docs/superpowers/plans/2026-05-07-p0-single-controller-persistence.md": {
|
||||
"description": "P0: Single-Controller Persistence — Implementation Plan",
|
||||
|
|
@ -9739,13 +9735,12 @@
|
|||
},
|
||||
"src/meson.build": {
|
||||
"description": "",
|
||||
"tokens": 672,
|
||||
"hash": "93a433217b982598",
|
||||
"size": 2519,
|
||||
"mtimeMs": 1787287969762.1196,
|
||||
"updatedAt": "2026-09-08T03:09:38.941Z",
|
||||
"source": "scan",
|
||||
"importance": 0.1036
|
||||
"tokens": 678,
|
||||
"hash": "3427120ceb281a48",
|
||||
"size": 2539,
|
||||
"mtimeMs": 1789358543806.4304,
|
||||
"updatedAt": "2026-09-14T04:02:23.846Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/meson.options": {
|
||||
"description": "dirty-content-fingerprint task 1: sibling `dirty_fingerprint` string option (default '') added next to commit_id/build_time",
|
||||
|
|
@ -9759,11 +9754,11 @@
|
|||
},
|
||||
".claude/skills/xce-build/SKILL.md": {
|
||||
"description": "build xce source code",
|
||||
"tokens": 4016,
|
||||
"hash": "1ffa5d8d2a6ee3c0",
|
||||
"size": 16166,
|
||||
"mtimeMs": 1788857080401.4075,
|
||||
"updatedAt": "2026-09-08T08:44:40.450Z",
|
||||
"tokens": 4561,
|
||||
"hash": "79eb234b59610c7d",
|
||||
"size": 18353,
|
||||
"mtimeMs": 1789388187356.294,
|
||||
"updatedAt": "2026-09-14T12:16:27.397Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/configs/limits.yaml": {
|
||||
|
|
@ -9999,6 +9994,249 @@
|
|||
"mtimeMs": 1789291943530.255,
|
||||
"updatedAt": "2026-09-13T09:32:23.567Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/specs/xce-harness-component/brief.md": {
|
||||
"description": "Brief: xce-harness-component",
|
||||
"tokens": 2634,
|
||||
"hash": "1b24a20f94332d72",
|
||||
"size": 10582,
|
||||
"mtimeMs": 1789353029453.049,
|
||||
"updatedAt": "2026-09-14T02:30:29.488Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/specs/xce-harness-component/spec.json": {
|
||||
"description": "",
|
||||
"tokens": 132,
|
||||
"hash": "18732e6b2ee5e235",
|
||||
"size": 459,
|
||||
"mtimeMs": 1789385267585.7998,
|
||||
"updatedAt": "2026-09-14T11:27:47.624Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/specs/xce-harness-component/requirements.md": {
|
||||
"description": "Requirements Document",
|
||||
"tokens": 2781,
|
||||
"hash": "beda5b2e0ece319d",
|
||||
"size": 11139,
|
||||
"mtimeMs": 1789377539807.4458,
|
||||
"updatedAt": "2026-09-14T09:18:59.847Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/specs/xce-harness-component/research.md": {
|
||||
"description": "Research & Design Decisions",
|
||||
"tokens": 4443,
|
||||
"hash": "b8fd012242634bc9",
|
||||
"size": 17854,
|
||||
"mtimeMs": 1789356488456.006,
|
||||
"updatedAt": "2026-09-14T03:28:08.493Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/specs/xce-harness-component/design.md": {
|
||||
"description": "Design Document: xce-harness-component",
|
||||
"tokens": 8421,
|
||||
"hash": "8b0dd6a7bf945a31",
|
||||
"size": 34011,
|
||||
"mtimeMs": 1789377568173.1108,
|
||||
"updatedAt": "2026-09-14T09:19:28.216Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".kiro/specs/xce-harness-component/tasks.md": {
|
||||
"description": "Implementation Plan: xce-harness-component",
|
||||
"tokens": 5013,
|
||||
"hash": "e71132dda2d409de",
|
||||
"size": 20089,
|
||||
"mtimeMs": 1789385224557.5405,
|
||||
"updatedAt": "2026-09-14T11:27:04.601Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/harness/meson.build": {
|
||||
"description": "",
|
||||
"tokens": 2723,
|
||||
"hash": "68eeae936bb3d875",
|
||||
"size": 10211,
|
||||
"mtimeMs": 1789365250311.1978,
|
||||
"updatedAt": "2026-09-14T05:54:10.359Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/controller/meson.build": {
|
||||
"description": "",
|
||||
"tokens": 3405,
|
||||
"hash": "91d958304c69ee28",
|
||||
"size": 12768,
|
||||
"mtimeMs": 1789364073591.1877,
|
||||
"updatedAt": "2026-09-14T05:34:33.639Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/controller/testsuite/controller_test.c": {
|
||||
"description": "include <argp.h>",
|
||||
"tokens": 2466,
|
||||
"hash": "2b6ebadd562247b5",
|
||||
"size": 9245,
|
||||
"mtimeMs": 1789364096229.3748,
|
||||
"updatedAt": "2026-09-14T05:34:56.279Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/harness/test.c": {
|
||||
"description": "include <argp.h>",
|
||||
"tokens": 66502,
|
||||
"hash": "e5b39f49995de1ca",
|
||||
"size": 249469,
|
||||
"mtimeMs": 1789362622151.017,
|
||||
"updatedAt": "2026-09-14T05:10:22.197Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/harness/joblist_display.c": {
|
||||
"description": "include \"joblist_display.h\"",
|
||||
"tokens": 1002,
|
||||
"hash": "0b3b410be5f99110",
|
||||
"size": 3757,
|
||||
"mtimeMs": 1789362622297.3796,
|
||||
"updatedAt": "2026-09-14T05:10:22.339Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/controller/testsuite/test_ctrlstatus.c": {
|
||||
"description": "include <stdatomic.h>",
|
||||
"tokens": 5869,
|
||||
"hash": "12179b429c637485",
|
||||
"size": 22339,
|
||||
"mtimeMs": 1789362622494.0896,
|
||||
"updatedAt": "2026-09-14T05:10:22.543Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/harness/CLAUDE.md": {
|
||||
"description": "XCE Harness (xce_test)",
|
||||
"tokens": 1243,
|
||||
"hash": "5f19adcb228d2d3e",
|
||||
"size": 4987,
|
||||
"mtimeMs": 1789385192671.2634,
|
||||
"updatedAt": "2026-09-14T11:26:32.715Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/harness/testsuite/harness_test.c": {
|
||||
"description": "include <argp.h>",
|
||||
"tokens": 858,
|
||||
"hash": "76ffe7960a203b43",
|
||||
"size": 3214,
|
||||
"mtimeMs": 1789398470715.5784,
|
||||
"updatedAt": "2026-09-14T15:07:50.753Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/harness/testsuite/test_joblist_display.c": {
|
||||
"description": "Declares char",
|
||||
"tokens": 2559,
|
||||
"hash": "e07cc3788dc83af4",
|
||||
"size": 9593,
|
||||
"mtimeMs": 1789365219692.1702,
|
||||
"updatedAt": "2026-09-14T05:53:39.743Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/tools/xce-build.sh": {
|
||||
"description": "",
|
||||
"tokens": 5473,
|
||||
"hash": "3e7647bc3a190f55",
|
||||
"size": 20542,
|
||||
"mtimeMs": 1789366341549.8474,
|
||||
"updatedAt": "2026-09-14T06:12:21.585Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".claude/skills/xce-test-ha/run-ha-soak.sh": {
|
||||
"description": "run-ha-soak.sh — driver for /xce-test-ha: deploy a 3-node XCE HA cluster, then",
|
||||
"tokens": 47176,
|
||||
"hash": "0e99bb6e2a2a9ece",
|
||||
"size": 179105,
|
||||
"mtimeMs": 1789368443287.2227,
|
||||
"updatedAt": "2026-09-14T06:47:23.336Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".claude/skills/xce-test-ha/SKILL.md": {
|
||||
"description": "XCE HA Failover Soak Test",
|
||||
"tokens": 10080,
|
||||
"hash": "dcb4b066592c38ce",
|
||||
"size": 40603,
|
||||
"mtimeMs": 1789368549893.6606,
|
||||
"updatedAt": "2026-09-14T06:49:09.930Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".claude/skills/xce-deploy-ha/SKILL.md": {
|
||||
"description": "XCE HA Cluster Deployment",
|
||||
"tokens": 7353,
|
||||
"hash": "1e8e687d4098e09c",
|
||||
"size": 29606,
|
||||
"mtimeMs": 1789369277149.5808,
|
||||
"updatedAt": "2026-09-14T07:01:17.189Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".claude/skills/xce-test-multihost/run-multihost-verify.sh": {
|
||||
"description": "run-multihost-verify.sh -- driver for /xce-test-multihost.",
|
||||
"tokens": 13089,
|
||||
"hash": "fbc502492e0cdd5a",
|
||||
"size": 49499,
|
||||
"mtimeMs": 1789369840899.9163,
|
||||
"updatedAt": "2026-09-14T07:10:40.944Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".claude/skills/xce-test-multihost/SKILL.md": {
|
||||
"description": "XCE Multi-Host Allocation Test Harness",
|
||||
"tokens": 5621,
|
||||
"hash": "40fab470cbf215f3",
|
||||
"size": 22481,
|
||||
"mtimeMs": 1789369892690.1973,
|
||||
"updatedAt": "2026-09-14T07:11:32.745Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".claude/skills/xce-test-resources/run-resource-verify.sh": {
|
||||
"description": "run-resource-verify.sh -- driver for /xce-test-resources: end-to-end",
|
||||
"tokens": 21734,
|
||||
"hash": "171f085c37cde37d",
|
||||
"size": 81757,
|
||||
"mtimeMs": 1789370608492.425,
|
||||
"updatedAt": "2026-09-14T07:23:28.537Z",
|
||||
"source": "hook"
|
||||
},
|
||||
".claude/skills/xce-test-resources/SKILL.md": {
|
||||
"description": "XCE Resource-Value Verification",
|
||||
"tokens": 3923,
|
||||
"hash": "65d7f4be7dc890df",
|
||||
"size": 15696,
|
||||
"mtimeMs": 1789370640510.2063,
|
||||
"updatedAt": "2026-09-14T07:24:00.560Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/controller/testsuite/test_rcfile_integration.sh": {
|
||||
"description": "test_rcfile_integration.sh — xce-test-rc-file integration test, shell-driven",
|
||||
"tokens": 4117,
|
||||
"hash": "c303d2f7277b89ca",
|
||||
"size": 16178,
|
||||
"mtimeMs": 1789386505203.6724,
|
||||
"updatedAt": "2026-09-14T11:48:25.249Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/controller/testsuite/clean_failover_preservation.sh": {
|
||||
"description": "clean_failover_preservation.sh — ha-term-safety task 5.2 live integration test.",
|
||||
"tokens": 4972,
|
||||
"hash": "f93c5af6592b482f",
|
||||
"size": 19935,
|
||||
"mtimeMs": 1789386507764.611,
|
||||
"updatedAt": "2026-09-14T11:48:27.819Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/tools/test-commit-durability.sh": {
|
||||
"description": "test-commit-durability.sh — bug-661 reproduction: committed jobs lost across failover.",
|
||||
"tokens": 9874,
|
||||
"hash": "bb9cffaf5573536e",
|
||||
"size": 37924,
|
||||
"mtimeMs": 1789386510249.3997,
|
||||
"updatedAt": "2026-09-14T11:48:30.290Z",
|
||||
"source": "hook"
|
||||
},
|
||||
"src/harness/testsuite/test_test_cli.c": {
|
||||
"description": "char: longjmp",
|
||||
"tokens": 42300,
|
||||
"hash": "b24a66b7d6b719f8",
|
||||
"size": 158624,
|
||||
"mtimeMs": 1789398458927.6282,
|
||||
"updatedAt": "2026-09-14T15:07:38.971Z",
|
||||
"source": "hook"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# anatomy.md
|
||||
|
||||
> Auto-maintained by OpenWolf. Last scanned: 2026-09-13T09:37:12.866Z
|
||||
> Files: 532 tracked | Anatomy hits: 0 | Misses: 0
|
||||
> Auto-maintained by OpenWolf. Last scanned: 2026-09-14T15:07:50.753Z
|
||||
> Files: 559 tracked | Anatomy hits: 0 | Misses: 0
|
||||
|
||||
## ./
|
||||
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
- `.mcp.json` (~7 tok)
|
||||
- `.opencode.json` (~7 tok)
|
||||
- `CHANGES.md` — XCE Change Log (~17327 tok)
|
||||
- `CLAUDE.md` — OpenWolf (~1806 tok)
|
||||
- `CLAUDE.md` — OpenWolf (~1848 tok)
|
||||
- `README.md` — Project documentation (~1157 tok)
|
||||
|
||||
## .agent-shell/transcripts/
|
||||
|
|
@ -27,7 +27,26 @@
|
|||
|
||||
## .claude/skills/xce-build/
|
||||
|
||||
- `SKILL.md` — build xce source code (~4016 tok)
|
||||
- `SKILL.md` — build xce source code (~4561 tok)
|
||||
|
||||
## .claude/skills/xce-deploy-ha/
|
||||
|
||||
- `SKILL.md` — XCE HA Cluster Deployment (~7353 tok)
|
||||
|
||||
## .claude/skills/xce-test-ha/
|
||||
|
||||
- `run-ha-soak.sh` — run-ha-soak.sh — driver for /xce-test-ha: deploy a 3-node XCE HA cluster, then (~47176 tok)
|
||||
- `SKILL.md` — XCE HA Failover Soak Test (~10080 tok)
|
||||
|
||||
## .claude/skills/xce-test-multihost/
|
||||
|
||||
- `run-multihost-verify.sh` — run-multihost-verify.sh -- driver for /xce-test-multihost. (~13089 tok)
|
||||
- `SKILL.md` — XCE Multi-Host Allocation Test Harness (~5621 tok)
|
||||
|
||||
## .claude/skills/xce-test-resources/
|
||||
|
||||
- `run-resource-verify.sh` — run-resource-verify.sh -- driver for /xce-test-resources: end-to-end (~21734 tok)
|
||||
- `SKILL.md` — XCE Resource-Value Verification (~3923 tok)
|
||||
|
||||
## .codegraph/
|
||||
|
||||
|
|
@ -575,6 +594,15 @@
|
|||
- `spec.json` (~674 tok)
|
||||
- `tasks.md` — Implementation Plan (~10811 tok)
|
||||
|
||||
## .kiro/specs/xce-harness-component/
|
||||
|
||||
- `brief.md` — Brief: xce-harness-component (~2634 tok)
|
||||
- `design.md` — Design Document: xce-harness-component (~8421 tok)
|
||||
- `requirements.md` — Requirements Document (~2781 tok)
|
||||
- `research.md` — Research & Design Decisions (~4443 tok)
|
||||
- `spec.json` (~132 tok)
|
||||
- `tasks.md` — Implementation Plan: xce-harness-component (~5013 tok)
|
||||
|
||||
## .kiro/specs/xce-node-manager/
|
||||
|
||||
- `design.md` — Overview (~12460 tok)
|
||||
|
|
@ -606,17 +634,17 @@
|
|||
## .kiro/steering/
|
||||
|
||||
- `api-standards.md` — API Standards (~1704 tok)
|
||||
- `build-deployment.md` — Build & Deployment (~2943 tok)
|
||||
- `build-deployment.md` — Build & Deployment (~3047 tok)
|
||||
- `config-design.md` — Configuration Design: What Belongs in Shared Config (~2053 tok)
|
||||
- `error-handling.md` — Error Handling Standards (~1367 tok)
|
||||
- `ha-async-io.md` — HA Protocol & Async I/O (~4721 tok)
|
||||
- `persistence.md` — WAL & Persistence Durability (~3851 tok)
|
||||
- `product.md` — Product Overview (~1509 tok)
|
||||
- `resource-accounting.md` — Resource Accounting: Reservation vs. Actual Usage for Real Resources (~3068 tok)
|
||||
- `roadmap.md` — Roadmap (~15320 tok)
|
||||
- `roadmap.md` — Roadmap (~15650 tok)
|
||||
- `scheduler-driver-equivalence.md` — Scheduler Driver Equivalence (~1520 tok)
|
||||
- `security.md` — Security Standards (~1960 tok)
|
||||
- `structure.md` — Project Structure (~1374 tok)
|
||||
- `structure.md` — Project Structure (~1405 tok)
|
||||
- `tech.md` — Technology Stack (~1517 tok)
|
||||
- `testing.md` — Testing Standards (~1006 tok)
|
||||
|
||||
|
|
@ -662,7 +690,7 @@
|
|||
## src/
|
||||
|
||||
- `flake.nix` (~1432 tok)
|
||||
- `meson.build` (~672 tok)
|
||||
- `meson.build` (~678 tok)
|
||||
- `meson.options` — dirty-content-fingerprint task 1: sibling `dirty_fingerprint` string option (default '') added next to commit_id/build_time (~124 tok)
|
||||
|
||||
## src/autoscaler/
|
||||
|
|
@ -832,6 +860,30 @@
|
|||
|
||||
- `limits.yaml` (~603 tok)
|
||||
|
||||
## src/controller/
|
||||
|
||||
- `meson.build` (~3405 tok)
|
||||
|
||||
## src/controller/testsuite/
|
||||
|
||||
- `clean_failover_preservation.sh` — clean_failover_preservation.sh — ha-term-safety task 5.2 live integration test. (~4972 tok)
|
||||
- `controller_test.c` — include <argp.h> (~2466 tok)
|
||||
- `test_ctrlstatus.c` — include <stdatomic.h> (~5869 tok)
|
||||
- `test_rcfile_integration.sh` — test_rcfile_integration.sh — xce-test-rc-file integration test, shell-driven (~4117 tok)
|
||||
|
||||
## src/harness/
|
||||
|
||||
- `CLAUDE.md` — XCE Harness (xce_test) (~1243 tok)
|
||||
- `joblist_display.c` — include "joblist_display.h" (~1002 tok)
|
||||
- `meson.build` (~2723 tok)
|
||||
- `test.c` — include <argp.h> (~66502 tok)
|
||||
|
||||
## src/harness/testsuite/
|
||||
|
||||
- `harness_test.c` — include <argp.h> (~858 tok)
|
||||
- `test_joblist_display.c` — Declares char (~2559 tok)
|
||||
- `test_test_cli.c` — char: longjmp (~42300 tok)
|
||||
|
||||
## src/include/
|
||||
|
||||
- `resreq.h` — if !defined(_RESREQ_H_) (~3310 tok)
|
||||
|
|
@ -876,3 +928,8 @@
|
|||
- `test_seqjob_allocator.c` — Declares char (~3701 tok)
|
||||
- `test_sim_contention_parity.c` — Declares calls (~19164 tok)
|
||||
- `test_sim_reconcile_unaccounted.c` — Declares documents (~26015 tok)
|
||||
|
||||
## src/tools/
|
||||
|
||||
- `test-commit-durability.sh` — test-commit-durability.sh — bug-661 reproduction: committed jobs lost across failover. (~9874 tok)
|
||||
- `xce-build.sh` (~5473 tok)
|
||||
|
|
|
|||
|
|
@ -21859,6 +21859,90 @@
|
|||
],
|
||||
"occurrences": 1,
|
||||
"last_seen": "2026-09-11T09:55:00Z"
|
||||
},
|
||||
{
|
||||
"id": "bug-1805",
|
||||
"timestamp": "2026-09-14T05:07:17.752283Z",
|
||||
"error_message": "xce-harness-component task 1.1: controller_unit_test had 29 test failures (all in test_test_cli.c/test_xcetest_process_entry.c) after xce_test moved from src/controller/testsuite/ to src/harness/ -- Expected 0 Was 127 and missing xce> prompt",
|
||||
"file": "src/controller/meson.build",
|
||||
"root_cause": "A bridging custom_target (xce_test_controller_link) created a symlink via command: ['ln', '-sf', '@INPUT0@', '@OUTPUT0@']. Meson expands @INPUT0@ to a build-root-relative path (harness/xce_test), but a relative symlink TARGET is resolved relative to the SYMLINK OWN DIRECTORY at dereference time, not the ln invocation cwd or the string reference frame it was written in. The resulting symlink at <build_dir>/controller/xce_test therefore looked for <build_dir>/controller/harness/xce_test, which does not exist, causing every subprocess-spawning test (resolve_xce_test_path()) to exec a missing binary (exit 127).",
|
||||
"fix": "FIXED (2026-09-14, xce-harness-component task 1.1). Changed the custom_target command to use the literal relative path ['ln', '-sf', '../harness/xce_test', '@OUTPUT0@'] instead of @INPUT0@, so the symlink text correctly resolves relative to controller/ up to harness/xce_test. Verified: controller_unit_test dropped from 29 failures to 0 (1228 Tests 0 Failures 0 Ignored), confirmed via the Unity binary's own printed summary line, not just meson's aggregate Ok/Fail count.",
|
||||
"tags": [
|
||||
"meson",
|
||||
"symlink",
|
||||
"custom_target",
|
||||
"relative-path",
|
||||
"build-system",
|
||||
"xce-harness-component"
|
||||
],
|
||||
"related_bugs": [],
|
||||
"occurrences": 1,
|
||||
"last_seen": "2026-09-14T05:07:17.752317Z"
|
||||
},
|
||||
{
|
||||
"id": "bug-1806",
|
||||
"timestamp": "2026-09-14T09:20:27.103747+00:00",
|
||||
"error_message": "xce-harness-component task 4.3: /xce-build controller alone still rebuilds harness/xce_test on disk under the default asan profile, apparently violating requirement 2.2 (controller-only build shall not produce xce_test as a side effect)",
|
||||
"file": "src/harness/meson.build, src/tools/xce-build.sh",
|
||||
"root_cause": "Deterministic, not a flake -- confirmed via build-log line analysis. meson test (run by /xce-build controller's default RUN_TESTS=1 asan profile via meson test --suite controller) rebuilds every registered test()'s build-order dependencies PROJECT-WIDE before filtering which tests actually RUN by --suite. harness_unit_test's test() registration (src/harness/meson.build) has depends: [xce_test] (added task 2.1, verified load-bearing in task 4.2), so any meson test invocation -- even one scoped to --suite controller -- transitively relinks xce_test. The explicit step is clean (never references xce_test); only the SUBSEQUENT meson test step touches it. Task 3.1's own validation missed this because it checked for the OLD path (controller/xce_test, correctly absent) rather than the NEW path (harness/xce_test, which does get rebuilt).",
|
||||
"fix": "NOT FIXED -- accepted as a documented Meson platform limitation (user decision 2026-09-14). Requirement 2.2 narrowed to scope the build system's guarantee to what it directly controls: the explicit compile-target list never names xce_test (still true and verified). Rejected alternatives: (a) add --no-rebuild to xce-build.sh's meson test calls -- non-trivial, since controller's OWN test suite already has 4 small standalone test binaries (sched_push_unit_test, sched_worker_change_unit_test, apiserver_push_unit_test, host_runusage_unit_test) not in its explicit compile target list, relying on this same auto-rebuild; fixing this properly means auditing and completing every component's explicit target list, with real regression risk; (b) restructure harness_unit_test's pty-spawning tests to drop the depends: edge and locate xce_test at runtime instead -- directly reverses the build-order guarantee task 4.2 just verified is real and load-bearing, reintroducing the stale/missing-binary risk it was added to prevent. requirements.md/design.md/tasks.md updated to reflect the narrowed, accurate guarantee.",
|
||||
"tags": [
|
||||
"meson",
|
||||
"test-runner",
|
||||
"build-dependency",
|
||||
"xce-harness-component",
|
||||
"accepted-limitation"
|
||||
],
|
||||
"related_bugs": [
|
||||
"bug-1805"
|
||||
],
|
||||
"occurrences": 1,
|
||||
"last_seen": "2026-09-14T09:20:27.103759+00:00"
|
||||
},
|
||||
{
|
||||
"id": "bug-1807",
|
||||
"timestamp": "2026-09-14T15:50:00Z",
|
||||
"error_message": "harness_unit_test's test_test_cli.c: 4 of 132 tests deterministically FAIL every run -- test_migrated_commands_sample_reject_unrecognized_flag (jobkill unrecognized-flag rejection), test_qctrl_hostctrl_confirm_gate_destructiveness_determination (qctrl -c or hostctrl -c prompt missing -- WHICH one shifts between builds), test_destructive_commands_prompt_by_default_and_yes_bypasses (upgradeconfig prompt missing), test_confirm_gate_session_toggle_skips_and_restores ('set +y' restore prompt missing). Each failing assertion burns its full 5000ms clitest_wait_for_text() timeout (total suite runtime ~28-29s vs ~9s once fixed) -- not a race, a genuine miss every time.",
|
||||
"file": "src/harness/test.c (all ~20 cmd_* handlers), src/harness/join_worker_args.c",
|
||||
"root_cause": "CONFIRMED via isolated pty repro (bypassing Unity/gdb entirely): every cmd_*() REPL command handler resets getopt_long() state with `optind = 1; opterr = 0;` before its own parse loop. glibc's getopt_long only re-initializes its internal static parser state (nextchar, first_nonopt/last_nonopt) when optind==0 OR on the process's very first-ever getopt_long() call (guarded by the internal __getopt_initialized flag) -- optind=1 alone is NOT sufficient once any earlier call in the same process has already run once. Since xce_test's REPL dispatches many independent cmd_*() calls (each with its OWN, differently-sized argv array) across the lifetime of one process, a command whose parse ends by consuming a short no-argument flag as its LAST token (e.g. `qctrl -q normal -a`, `hostctrl -h node01 -o`) leaves stale internal state that corrupts the NEXT unrelated command's getopt_long() call -- observed corrupting the NEXT command so badly that argv[0] (the command's own name, e.g. 'upgradeconfig' or 'jobkill') is misread as an unrecognized flag via flagspec_reject(). 100% reproducible in isolation: `qctrl -q normal -a` immediately followed by ANY other command (upgradeconfig, jobkill) corrupts that next command every time; the same session's commands run individually/first are unaffected. Explains why the specific victim test shifted between builds (bug-1807 was first seen failing on hostctrl -c, then qctrl -c after an unrelated same-file edit) -- runtime sequence-dependent, not random.",
|
||||
"fix": "FIXED. Changed all 20 occurrences of `optind = 1;` in src/harness/test.c and the 1 occurrence in src/harness/join_worker_args.c to `optind = 0;` (the documented glibc idiom that forces getopt_long to fully reinitialize, including nextchar/first_nonopt/last_nonopt, on every independent parse). Verified: (1) the 3 isolated minimal pty repros that previously reproduced the corruption 100% of the time now pass cleanly; (2) harness_unit_test run 10x consecutively under the debug profile: 132 Tests 0 Failures every run (was 4 Failures every run pre-fix), runtime dropped from ~28-29s to ~8-9s per run, confirming the failures were full timeout burns, not near-miss races; (3) full `/xce-build harness asan` (meson test, ASAN-instrumented) also reports 5/5 OK including harness_unit_test, no sanitizer findings.",
|
||||
"tags": [
|
||||
"confirmed",
|
||||
"fixed",
|
||||
"getopt",
|
||||
"getopt_long",
|
||||
"cli-parsing",
|
||||
"xce_test",
|
||||
"harness_unit_test",
|
||||
"test_test_cli.c",
|
||||
"flagspec"
|
||||
],
|
||||
"related_bugs": [],
|
||||
"occurrences": 1,
|
||||
"last_seen": "2026-09-14T15:50:00Z"
|
||||
},
|
||||
{
|
||||
"id": "bug-1808",
|
||||
"timestamp": "2026-09-14T15:50:00Z",
|
||||
"error_message": "src/harness/testsuite/test_test_cli.c: a spawned xce_test child process (clitest_spawn/clitest_spawn_ex) plus its pty master fd and stderr pipe fd leak whenever a TEST_ASSERT_* assertion fails partway through the owning test function, because every test relies on its OWN clitest_kill_and_reap()+clitest_close() calls placed inline at the bottom of the function body -- code that Unity's longjmp-based TEST_PROTECT()/TEST_ABORT() abort mechanism skips entirely on assertion failure. Directly observed: 4 live, idle `xce_test --norc` child processes still running (blocked forever on their own prompt) under one in-progress harness_unit_test invocation, discovered while investigating bug-1807's failures.",
|
||||
"file": "src/harness/testsuite/test_test_cli.c, src/harness/testsuite/harness_test.c",
|
||||
"root_cause": "Design gap, not a logic error in any specific test: clitest_kill_and_reap()/clitest_close() were documented as a mandatory safety net ('every caller is required to always end a session with clitest_kill_and_reap() regardless of which path was taken') but placed only at each test function's own normal-exit code path. Unity's RUN_TEST() macro DOES guarantee tearDown() runs after every test (pass, fail, or aborted-via-longjmp), but harness_test.c's shared tearDown() (used by all 13 Unity test groups linked into this binary, most unrelated to clitest) was a no-op beyond a cosmetic separator print -- it never reaped a still-open clitest session.",
|
||||
"fix": "FIXED. Added a static clitest_session_t mirror (g_last_session) in test_test_cli.c updated by clitest_spawn_ex() (set on successful spawn), clitest_kill_and_reap() (reaped flag synced), and clitest_close() (cleared) -- a STATIC-storage mirror was required rather than tracking a pointer into the aborted test's own local `sess`, since that stack frame is unwound by the longjmp and would leave a dangling pointer. Exposed a new clitest_reap_leaked_session() function, called from harness_test.c's tearDown() (now declared extern there), which force-kills+reaps+closes any session left open when a test aborted before reaching its own inline cleanup. Only one clitest session is ever open at a time in this file (verified), so a single mirror slot is sufficient. Verified via ASAN build (xce.build): no LeakSanitizer or other sanitizer findings from the new code across a clean 5/5 harness suite run.",
|
||||
"tags": [
|
||||
"fixed",
|
||||
"process-leak",
|
||||
"fd-leak",
|
||||
"unity",
|
||||
"longjmp",
|
||||
"test-infrastructure",
|
||||
"test_test_cli.c",
|
||||
"clitest"
|
||||
],
|
||||
"related_bugs": [
|
||||
"bug-1807"
|
||||
],
|
||||
"occurrences": 1,
|
||||
"last_seen": "2026-09-14T15:50:00Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,3 +235,5 @@
|
|||
- **(2026-09-11, bug-1802/bug-1803) A user asking "how do I skip past N uninteresting things to the next interesting one" wants a ONE-TIME navigation query, not a recurring pause condition — do not model it as a breakpoint (or any other persistent/repeatedly-firing mechanism), even when a breakpoint mechanism already exists and technically CAN express the match condition.** Shipped `break ANY` (matches any event, so `continue` skips dummy/empty sessions) for exactly this ask; it worked for the dummy-sessions case but ALSO kept firing on every matching event once inside a busy, non-dummy session — the user immediately reported it "introduces too many breaks in a single session," since a breakpoint's whole nature is to keep firing until deleted, wrong for a need that's satisfied the first time. Replaced with a one-shot informational display instead (`info summary` now shows "next non-dummy session: N -- run `step M` to reach it", from a read-only forward-scan-and-rewind prescan of the replay file) — no persistent state, no repeated firing, just an answer to "where should I jump to" that the existing `step N` primitive already handles once known. **General lesson: when a feature request has the shape "let me get from A to the next B, skipping everything in between," prefer a query/display that tells the operator where B is (so they use an existing jump/skip primitive) over a new watch/trigger/breakpoint-style mechanism that fires repeatedly — the latter only matches the ask for the FIRST hit and actively works against it afterward.** Also worth remembering: a `sim.c`-owned prescan function must return RELATIVE counts, not absolute ones requiring `xce_sched_repl_state_t`'s full definition — that type is only fully defined in `repl_internal.h` (an incomplete/opaque type in `sim.c` by this project's own Simulation Isolation boundary), caught immediately by a real compile error (`invalid use of incomplete typedef`) on the first attempt to dereference `sim->repl_state->session_count` from within `sim.c`.
|
||||
- **(2026-09-11, bug-1804) When two different code paths can each independently decide "this job is now running" (a live scheduler's own dispatch decision vs. a separately-recorded worker-confirmation event), and a design has to pick ONE as authoritative for `job->state`, the "right" answer is a genuine design fork, not a factual question with one correct resolution — surface it to the user rather than assuming either reading.** `scheduler-sim-eager-reconciliation`'s own research.md had ALREADY correctly researched this exact question ("does bug-1624 already close this gap?") and correctly concluded bug-1624's live in-memory `job->state = RUN` write is not itself a recordable event, so a recording's separately-recorded `JOB_STATE_CHANGE` genuinely CAN land rounds later — a true fact. But then it built a design on TOP of that fact (defer `job->state` to the confirmation event's own timing) without that choice being forced by the fact itself; the equally-valid alternative (reconstruct what the live scheduler's OWN state field would have shown, i.e. RUN synchronously at dispatch, matching bug-1624 exactly) was never surfaced as a choice. Live use exposed the shipped choice's cost directly (a job showing PEND for several sessions after its own DISPATCH already printed, reading as a bug) — the user then explicitly picked the other interpretation. **When you find a factually-correct research conclusion with a DESIGN DECISION built on top of it that could have gone the other way, don't just implement whichever the existing spec already chose — ask which one the user actually wants, especially when the user's own stated mental model points the other direction.** Also: when revising an `implementation-complete` Kiro spec after a design-decision reversal, update requirements.md/design.md/research.md/tasks.md IN PLACE with dated "Revision"/"Correction" notes (this codebase's own established pattern, e.g. design.md's pre-existing "Correction (2026-09-07, bug-1759/bug-1779)" block) rather than leaving stale prose that no longer matches the code — a future reader trusting the unrevised research.md conclusion as still-current design intent is exactly how this class of drift compounds.
|
||||
- **(2026-09-11, bug-1804) A test that calls a "re-derive from scratch" function (`sched_account_jobs()`) a SECOND time to prove a later event didn't change anything must reset the state it re-derives FIRST (`core_reset_workers()`), exactly mirroring the real per-round `xce_core_begin_session()`-then-`sched_account_jobs()` sequence — calling it twice back-to-back with no reset in between is a test-methodology artifact (an artificial double-charge, e.g. `resInUse` going 4.0→8.0) that can never happen in real production flow, not a real bug.** Caught immediately by RED/GREEN: the first draft's "redundant confirmation event must not double-charge" assertion failed with `Expected 4 Was 8` purely because the test itself skipped the reset step production always performs — fixed by calling `core_reset_workers()` (white-box-includable from `core_session.c`, already `#include`d in this test file) before the second `sched_account_jobs()` call, not by touching any production code. General pattern: before treating a `sched_account_jobs()`-adjacent test failure as evidence of a real double-charge bug, check whether the test itself reproduces the real reset-then-resum round-boundary sequence, or just calls the resum half twice.
|
||||
- **(2026-09-14, bug-1807) `optind = 1;` alone does NOT fully reset glibc `getopt_long()` state between independent parses sharing the same process — use `optind = 0;` instead.** glibc only calls its internal `_getopt_initialize()` (which clears the static `nextchar`/`first_nonopt`/`last_nonopt` scan state) when `optind == 0`, or on the process's very first-ever `getopt_long()` call (gated by an internal `__getopt_initialized` flag that latches true forever after). `xce_test`'s REPL dispatches many independent `cmd_*()` handlers per process lifetime, each with its own differently-sized `argv`; every one of them reset with `optind = 1; opterr = 0;` only (20 call sites in `test.c` + 1 in `join_worker_args.c`, ALL of them, no exceptions — this was systemic, not a one-off typo). Confirmed via a 100%-reproducible isolated pty repro, bypassing Unity/gdb entirely: a command whose parse ends by consuming a short no-argument flag as its LAST token (`qctrl -q normal -a`, `hostctrl -h node01 -o`) leaves stale internal state that corrupts the very next unrelated `getopt_long()` call so badly the next command's own name (`argv[0]`, e.g. `"upgradeconfig"`) gets misread as an unrecognized flag. This surfaced as 4 of `harness_unit_test`'s 132 tests deterministically (not flakily — 20/20 identical repeat runs) failing, each burning its full 5s assertion-wait timeout (~28s total suite runtime vs ~9s once fixed) — and WHICH of several structurally-similar assertions failed shifted between two otherwise-unrelated builds of the same source, which is the tell for "residual interpreter/parser state carried across unrelated calls in one process," not a logic bug in the specific command being blamed. **General rule: any C code that resets `getopt`/`getopt_long` state for a fresh, independent parse (as opposed to genuinely continuing scan on the SAME `argv` across multiple calls) must use `optind = 0`, never `optind = 1` — `1` is only correct for the very first parse of a process, and coincidentally "worked" in ad-hoc single-command manual testing here precisely because that's always a fresh process.** Fixed by a blanket `optind = 1;` → `optind = 0;` replace across both files; verified via 3 targeted isolated repros passing, `harness_unit_test` 10x clean (132/132, 0 Failures every run), and a full ASAN `/xce-build harness` run (5/5 OK, no sanitizer findings).
|
||||
- **(2026-09-14, bug-1808) Unity's `TEST_ASSERT_*` macros abort a failing test via `longjmp()` (`TEST_PROTECT()`), which skips every line of code AFTER the failing assertion in that same function — including cleanup code placed only at the bottom of the function body (e.g. `clitest_kill_and_reap()`+`clitest_close()` in `test_test_cli.c`, tearing down a spawned pty-driven child process).** A single assertion failure anywhere mid-test therefore leaks that test's spawned child (left running forever, blocked on its own prompt) plus its pty/pipe fds — confirmed directly by finding 4 live orphaned `xce_test --norc` processes under one in-progress `harness_unit_test` run. Unity DOES guarantee `tearDown()` runs after every `RUN_TEST()` regardless of pass/fail/abort, so that (not each test's own inline "happy path" cleanup) is the only reliable place to catch this — but `harness_test.c`'s shared `tearDown()` (used by all 13 Unity test groups in that binary) was a no-op beyond a cosmetic print. **General rule: in any Unity (or other longjmp-based C test framework) suite, resource cleanup for a value that only exists on ONE test function's own stack must not rely on inline code after the last assertion — either wire it through the framework's guaranteed-to-run teardown hook, or track it in a process-wide static/global (not a stack pointer, which dangles once the longjmp unwinds past it) that the teardown hook can safely inspect and reap.** Fixed via a static `clitest_session_t` mirror updated by spawn/kill_and_reap/close, reaped from `harness_test.c`'s `tearDown()`; ASAN build found no sanitizer issues in the new code.
|
||||
|
|
|
|||
158
.wolf/memory.md
158
.wolf/memory.md
|
|
@ -4549,3 +4549,161 @@
|
|||
|------|--------|---------|---------|--------|
|
||||
| 02:32 | Created reports/sep06-sep12-2026.md | — | ~3109 |
|
||||
| 02:37 | Edited CHANGES.md | modified docs() | ~2946 |
|
||||
| 19:16 | Session end: 2 writes across 2 files (sep06-sep12-2026.md, CHANGES.md) | 6 reads | ~16580 tok |
|
||||
|
||||
## Session: 2026-09-14 19:16
|
||||
|
||||
| Time | Action | File(s) | Outcome | ~Tokens |
|
||||
|------|--------|---------|---------|--------|
|
||||
| 19:30 | Created .kiro/specs/xce-harness-component/brief.md | — | ~2810 |
|
||||
| 19:39 | Edited .kiro/steering/roadmap.md | 3→4 lines | ~372 |
|
||||
| 19:46 | Created .kiro/specs/xce-harness-component/spec.json | — | ~130 |
|
||||
| 19:46 | Created .kiro/specs/xce-harness-component/requirements.md | — | ~567 |
|
||||
| 19:50 | Created .kiro/specs/xce-harness-component/requirements.md | — | ~2592 |
|
||||
| 19:50 | Edited .kiro/specs/xce-harness-component/spec.json | 9→9 lines | ~66 |
|
||||
| 20:01 | Edited .kiro/specs/xce-harness-component/spec.json | 4→4 lines | ~22 |
|
||||
| 20:06 | Created .kiro/specs/xce-harness-component/research.md | — | ~3858 |
|
||||
| 20:08 | Created .kiro/specs/xce-harness-component/design.md | — | ~6724 |
|
||||
| 20:09 | Edited .kiro/specs/xce-harness-component/design.md | 4→7 lines | ~314 |
|
||||
| 20:09 | Edited .kiro/specs/xce-harness-component/spec.json | 13→13 lines | ~85 |
|
||||
| 20:25 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~59 |
|
||||
| 20:25 | Edited .kiro/specs/xce-harness-component/design.md | "src/include/ctrlstatus_fm" → "src/include/xce/ctrlstatu" | ~126 |
|
||||
| 20:25 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~61 |
|
||||
| 20:25 | Edited .kiro/specs/xce-harness-component/design.md | 3→3 lines | ~446 |
|
||||
| 20:26 | Edited .kiro/specs/xce-harness-component/design.md | expanded (+12 lines) | ~659 |
|
||||
| 20:26 | Edited .kiro/specs/xce-harness-component/design.md | 3→4 lines | ~204 |
|
||||
| 20:26 | Edited .kiro/specs/xce-harness-component/design.md | 2→2 lines | ~123 |
|
||||
| 20:26 | Edited .kiro/specs/xce-harness-component/design.md | 28→29 lines | ~889 |
|
||||
| 20:27 | Edited .kiro/specs/xce-harness-component/design.md | 4→4 lines | ~75 |
|
||||
| 20:27 | Edited .kiro/specs/xce-harness-component/design.md | controller_unit_test() → suite() | ~80 |
|
||||
| 20:27 | Edited .kiro/specs/xce-harness-component/design.md | "harness_unit_test" → "s five " | ~151 |
|
||||
| 20:27 | Edited .kiro/specs/xce-harness-component/research.md | 2→3 lines | ~487 |
|
||||
| 20:27 | Edited .kiro/specs/xce-harness-component/research.md | expanded (+8 lines) | ~907 |
|
||||
| 20:28 | Edited .kiro/specs/xce-harness-component/research.md | inline fix | ~207 |
|
||||
| 20:28 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~373 |
|
||||
| 20:31 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~130 |
|
||||
| 20:31 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~62 |
|
||||
| 20:31 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~26 |
|
||||
| 20:35 | Edited .kiro/specs/xce-harness-component/spec.json | 4→4 lines | ~20 |
|
||||
| 20:38 | Created .kiro/specs/xce-harness-component/tasks.md | — | ~2635 |
|
||||
| 20:45 | Created .kiro/specs/xce-harness-component/tasks.md | — | ~2676 |
|
||||
| 20:51 | Edited .kiro/specs/xce-harness-component/tasks.md | 6→8 lines | ~649 |
|
||||
| 20:52 | Edited .kiro/specs/xce-harness-component/tasks.md | 9→11 lines | ~673 |
|
||||
| 20:52 | Edited .kiro/specs/xce-harness-component/spec.json | 18→18 lines | ~105 |
|
||||
| 20:54 | Edited .kiro/specs/xce-harness-component/spec.json | 6→6 lines | ~31 |
|
||||
| 21:01 | Created src/harness/meson.build | — | ~387 |
|
||||
| 21:02 | Edited src/meson.build | 2→3 lines | ~16 |
|
||||
| 21:03 | Edited src/controller/meson.build | removed 30 lines | ~21 |
|
||||
| 21:03 | Edited src/controller/meson.build | removed 23 lines | ~20 |
|
||||
| 21:03 | Edited src/controller/meson.build | removed 27 lines | ~20 |
|
||||
| 21:04 | Edited src/controller/meson.build | — | ~0 |
|
||||
| 21:04 | Edited src/controller/meson.build | 7→8 lines | ~146 |
|
||||
| 21:04 | Edited src/controller/testsuite/controller_test.c | removed 12 lines | ~12 |
|
||||
| 21:04 | Edited src/controller/testsuite/controller_test.c | removed 12 lines | ~10 |
|
||||
| 21:06 | Edited src/controller/meson.build | 8→7 lines | ~122 |
|
||||
| 21:08 | Edited src/harness/meson.build | modified TEMPORARY() | ~174 |
|
||||
| 21:13 | Edited src/controller/meson.build | 2→2 lines | ~32 |
|
||||
| 21:13 | Edited src/controller/meson.build | expanded (+18 lines) | ~311 |
|
||||
| 21:29 | Edited src/controller/meson.build | modified TEMPORARY() | ~471 |
|
||||
| 21:48 | Edited src/controller/meson.build | inline fix | ~17 |
|
||||
| 22:05 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~311 |
|
||||
| 22:05 | Edited .kiro/specs/xce-harness-component/design.md | 1→2 lines | ~271 |
|
||||
| 22:06 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~37 |
|
||||
| 22:06 | Edited .kiro/specs/xce-harness-component/tasks.md | expanded (+7 lines) | ~518 |
|
||||
| 22:10 | Edited src/harness/test.c | "ctrlstatus_fmt.h" → "xce/ctrlstatus_fmt.h" | ~20 |
|
||||
| 22:10 | Edited src/harness/joblist_display.c | "ctrlstatus_fmt.h" → "xce/ctrlstatus_fmt.h" | ~17 |
|
||||
| 22:10 | Edited src/controller/testsuite/test_ctrlstatus.c | "ctrlstatus_fmt.h" → "xce/ctrlstatus_fmt.h" | ~20 |
|
||||
| 22:10 | Edited src/harness/meson.build | removed 10 lines | ~19 |
|
||||
| 22:19 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~23 |
|
||||
| 22:23 | Created src/harness/CLAUDE.md | — | ~1224 |
|
||||
| 22:28 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~12 |
|
||||
| 22:33 | Created src/harness/testsuite/harness_test.c | — | ~719 |
|
||||
| 22:33 | Edited src/harness/meson.build | modified suite() | ~936 |
|
||||
| 22:34 | Edited src/harness/meson.build | 5→5 lines | ~54 |
|
||||
| 22:34 | Edited src/controller/meson.build | 7→5 lines | ~43 |
|
||||
| 22:34 | Edited src/controller/meson.build | removed 26 lines | ~36 |
|
||||
| 22:34 | Edited src/controller/testsuite/controller_test.c | 4→2 lines | ~23 |
|
||||
| 22:34 | Edited src/controller/testsuite/controller_test.c | 4→2 lines | ~19 |
|
||||
| 22:48 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~38 |
|
||||
| 22:49 | Edited .kiro/specs/xce-harness-component/tasks.md | 1→2 lines | ~214 |
|
||||
| 22:53 | Edited src/harness/testsuite/test_joblist_display.c | "ctrlstatus_fmt.h" → "xce/ctrlstatus_fmt.h" | ~21 |
|
||||
| 22:54 | Edited src/harness/meson.build | expanded (+111 lines) | ~1490 |
|
||||
| 23:08 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~19 |
|
||||
| 23:08 | Edited .kiro/specs/xce-harness-component/tasks.md | 1→2 lines | ~160 |
|
||||
| 23:12 | Edited src/tools/xce-build.sh | "Components: all (default)" → "Components: all (default)" | ~30 |
|
||||
| 23:12 | Edited src/tools/xce-build.sh | expanded (+9 lines) | ~247 |
|
||||
| 23:44 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~82 |
|
||||
| 23:44 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~22 |
|
||||
| 23:47 | Edited .claude/skills/xce-test-ha/run-ha-soak.sh | 2→7 lines | ~122 |
|
||||
| 23:47 | Edited .claude/skills/xce-test-ha/run-ha-soak.sh | expanded (+6 lines) | ~175 |
|
||||
| 23:47 | Edited .claude/skills/xce-test-ha/SKILL.md | 3→3 lines | ~50 |
|
||||
| 23:47 | Edited .claude/skills/xce-test-ha/SKILL.md | modified skill() | ~229 |
|
||||
| 23:48 | Edited .claude/skills/xce-test-ha/SKILL.md | 12→15 lines | ~189 |
|
||||
| 23:48 | Edited .claude/skills/xce-test-ha/SKILL.md | inline fix | ~21 |
|
||||
| 23:48 | Edited .claude/skills/xce-test-ha/SKILL.md | 2→3 lines | ~158 |
|
||||
| 23:49 | Edited .claude/skills/xce-test-ha/SKILL.md | 4→7 lines | ~99 |
|
||||
| 23:56 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~18 |
|
||||
| 00:01 | Edited .claude/skills/xce-deploy-ha/SKILL.md | expanded (+11 lines) | ~274 |
|
||||
| 00:01 | Edited .claude/skills/xce-deploy-ha/SKILL.md | 1→2 lines | ~210 |
|
||||
| 00:08 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~23 |
|
||||
| 00:10 | Edited .claude/skills/xce-test-multihost/run-multihost-verify.sh | 4→9 lines | ~157 |
|
||||
| 00:10 | Edited .claude/skills/xce-test-multihost/run-multihost-verify.sh | expanded (+8 lines) | ~176 |
|
||||
| 00:10 | Edited .claude/skills/xce-test-multihost/run-multihost-verify.sh | modified 4() | ~243 |
|
||||
| 00:11 | Edited .claude/skills/xce-test-multihost/SKILL.md | expanded (+12 lines) | ~357 |
|
||||
| 00:11 | Edited .claude/skills/xce-test-multihost/SKILL.md | 2→4 lines | ~68 |
|
||||
| 00:11 | Edited .claude/skills/xce-test-multihost/SKILL.md | 2→2 lines | ~32 |
|
||||
| 00:21 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~22 |
|
||||
| 00:23 | Edited .claude/skills/xce-test-resources/run-resource-verify.sh | 4→9 lines | ~170 |
|
||||
| 00:23 | Edited .claude/skills/xce-test-resources/run-resource-verify.sh | expanded (+7 lines) | ~168 |
|
||||
| 00:23 | Edited .claude/skills/xce-test-resources/SKILL.md | modified vars() | ~487 |
|
||||
| 00:24 | Edited .claude/skills/xce-test-resources/SKILL.md | 10→14 lines | ~208 |
|
||||
| 00:29 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~23 |
|
||||
| 00:34 | Edited CLAUDE.md | inline fix | ~60 |
|
||||
| 00:34 | Edited CLAUDE.md | 6→7 lines | ~83 |
|
||||
| 00:34 | Edited .kiro/steering/build-deployment.md | 3→4 lines | ~64 |
|
||||
| 00:34 | Edited .kiro/steering/build-deployment.md | "controller" → "harness" | ~80 |
|
||||
| 00:34 | Edited .kiro/steering/build-deployment.md | 2→3 lines | ~63 |
|
||||
| 00:34 | Edited .kiro/steering/build-deployment.md | inline fix | ~96 |
|
||||
| 00:34 | Edited .kiro/steering/build-deployment.md | "lib → {controller, worker" → "lib → {controller, harnes" | ~22 |
|
||||
| 00:42 | Edited .kiro/steering/build-deployment.md | inline fix | ~76 |
|
||||
| 00:45 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~24 |
|
||||
| 00:47 | Edited .kiro/steering/structure.md | 2→3 lines | ~57 |
|
||||
| 00:47 | Edited .kiro/steering/structure.md | inline fix | ~41 |
|
||||
| 00:48 | Edited .kiro/steering/structure.md | inline fix | ~39 |
|
||||
| 00:55 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~19 |
|
||||
| 00:56 | Edited .kiro/specs/xce-harness-component/tasks.md | 1→2 lines | ~216 |
|
||||
| 01:10 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~17 |
|
||||
| 01:10 | Edited .kiro/specs/xce-harness-component/tasks.md | modified found() | ~263 |
|
||||
| 01:35 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~21 |
|
||||
| 02:18 | Edited .kiro/specs/xce-harness-component/requirements.md | "xce_test" → "s explicit compile step s" | ~37 |
|
||||
| 02:18 | Edited .kiro/specs/xce-harness-component/requirements.md | 1→2 lines | ~450 |
|
||||
| 02:19 | Edited .kiro/specs/xce-harness-component/design.md | inline fix | ~50 |
|
||||
| 02:19 | Edited .kiro/specs/xce-harness-component/design.md | 4→5 lines | ~415 |
|
||||
| 02:19 | Edited .kiro/specs/xce-harness-component/tasks.md | 5→5 lines | ~210 |
|
||||
| 02:20 | Edited .kiro/specs/xce-harness-component/tasks.md | 1→2 lines | ~368 |
|
||||
| 03:36 | Edited .kiro/specs/xce-harness-component/tasks.md | inline fix | ~18 |
|
||||
| 03:36 | Edited .kiro/specs/xce-harness-component/tasks.md | 1→2 lines | ~216 |
|
||||
| 04:26 | Edited src/harness/CLAUDE.md | point() → tests() | ~444 |
|
||||
| 04:27 | Edited .kiro/specs/xce-harness-component/tasks.md | 1→2 lines | ~339 |
|
||||
| 04:27 | Edited .kiro/specs/xce-harness-component/spec.json | 3→3 lines | ~28 |
|
||||
| 04:47 | Edited .claude/skills/xce-build/SKILL.md | "Build XCE components with" → "Build XCE components with" | ~106 |
|
||||
| 04:47 | Edited .claude/skills/xce-build/SKILL.md | inline fix | ~38 |
|
||||
| 04:48 | Edited .claude/skills/xce-build/SKILL.md | "controller" → "xce_test" | ~314 |
|
||||
| 04:48 | Edited src/controller/testsuite/test_rcfile_integration.sh | "${XCE_TEST_BIN:-$REPO_ROO" → "${XCE_TEST_BIN:-$REPO_ROO" | ~19 |
|
||||
| 04:48 | Edited src/controller/testsuite/test_rcfile_integration.sh | "FAIL: xce_test not found/" → "FAIL: xce_test not found/" | ~27 |
|
||||
| 04:48 | Edited src/controller/testsuite/clean_failover_preservation.sh | "${XCE_TEST_BIN:-$REPO_ROO" → "${XCE_TEST_BIN:-$REPO_ROO" | ~19 |
|
||||
| 04:48 | Edited src/controller/testsuite/clean_failover_preservation.sh | inline fix | ~26 |
|
||||
| 04:48 | Edited src/tools/test-commit-durability.sh | inline fix | ~23 |
|
||||
| 04:48 | Edited src/tools/test-commit-durability.sh | "$WORKTREE/src/xce.build/c" → "$WORKTREE/src/xce.build/h" | ~14 |
|
||||
| 04:55 | Session end: 140 writes across 25 files (brief.md, roadmap.md, spec.json, requirements.md, research.md) | 67 reads | ~167315 tok |
|
||||
|
||||
## Session: 2026-09-14 04:55
|
||||
|
||||
| Time | Action | File(s) | Outcome | ~Tokens |
|
||||
|------|--------|---------|---------|--------|
|
||||
| 05:16 | Edited .claude/skills/xce-build/SKILL.md | modified heaviest() | ~619 |
|
||||
| 08:06 | Edited src/harness/testsuite/test_test_cli.c | 10→11 lines | ~76 |
|
||||
| 08:06 | Edited src/harness/testsuite/test_test_cli.c | added 4 condition(s) | ~608 |
|
||||
| 08:07 | Edited src/harness/testsuite/test_test_cli.c | added 1 condition(s) | ~86 |
|
||||
| 08:07 | Edited src/harness/testsuite/test_test_cli.c | added 1 condition(s) | ~95 |
|
||||
| 08:07 | Edited src/harness/testsuite/harness_test.c | modified that() | ~184 |
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ int join_worker_parse_attrs(int argc, char* argv[], hostattrs_t* attrs)
|
|||
attrs->hostmodel = "Intel64";
|
||||
attrs->hosttype = "LINUX64";
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
while ((opt = getopt_long(argc, argv, optstring, long_opts, NULL))
|
||||
|
|
|
|||
|
|
@ -1626,7 +1626,7 @@ int cmd_walcompare(int argc, char* argv[])
|
|||
char optstring[8];
|
||||
char posix_optstring[sizeof(optstring) + 1];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(walcompare_flags, WALCOMPARE_NFLAGS, long_opts,
|
||||
|
|
@ -2043,7 +2043,7 @@ int cmd_hello(int argc, char* argv[])
|
|||
struct option long_opts[HELLO_NFLAGS + 1];
|
||||
char optstring[32];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(hello_flags, HELLO_NFLAGS, long_opts, optstring,
|
||||
|
|
@ -2131,7 +2131,7 @@ int cmd_shutdown(int argc, char* argv[])
|
|||
char optstring[16];
|
||||
shutdown_call_t* call;
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(shutdown_flags, SHUTDOWN_NFLAGS, long_opts,
|
||||
|
|
@ -2231,7 +2231,7 @@ int cmd_reslist(int argc, char* argv[])
|
|||
struct option long_opts[RESLIST_NFLAGS + 1];
|
||||
char optstring[8];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(reslist_flags, RESLIST_NFLAGS, long_opts,
|
||||
|
|
@ -2374,7 +2374,7 @@ int cmd_workerlist(int argc, char* argv[])
|
|||
struct option long_opts[WORKERLIST_NFLAGS + 1];
|
||||
char optstring[8];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(workerlist_flags, WORKERLIST_NFLAGS, long_opts,
|
||||
|
|
@ -2662,7 +2662,7 @@ int cmd_joblist(int argc, char* argv[])
|
|||
struct option long_opts[JOBLIST_NFLAGS + 1];
|
||||
char optstring[8];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(joblist_flags, JOBLIST_NFLAGS, long_opts,
|
||||
|
|
@ -3238,7 +3238,7 @@ int cmd_jobinfo(int argc, char* argv[])
|
|||
struct option long_opts[JOBINFO_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(jobinfo_flags, JOBINFO_NFLAGS, long_opts,
|
||||
|
|
@ -3381,7 +3381,7 @@ int cmd_jobrun(int argc, char* argv[])
|
|||
struct option long_opts[JOBRUN_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(jobrun_flags, JOBRUN_NFLAGS, long_opts, optstring,
|
||||
|
|
@ -3550,7 +3550,7 @@ int cmd_jobsub(int argc, char* argv[])
|
|||
struct option long_opts[JOBSUB_NFLAGS + 1];
|
||||
char optstring[32];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
memset(&submit, 0x0, sizeof(submit));
|
||||
|
|
@ -3898,7 +3898,7 @@ int cmd_resval(int argc, char* argv[])
|
|||
struct option long_opts[RESVAL_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(resval_flags, RESVAL_NFLAGS, long_opts, optstring,
|
||||
|
|
@ -4046,7 +4046,7 @@ int cmd_jobkill(int argc, char* argv[])
|
|||
struct option long_opts[JOBKILL_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
signo = SIGTERM;
|
||||
|
||||
|
|
@ -4304,7 +4304,7 @@ int cmd_qctrl(int argc, char* argv[])
|
|||
struct option long_opts[QCTRL_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(qctrl_flags, QCTRL_NFLAGS, long_opts, optstring,
|
||||
|
|
@ -4458,7 +4458,7 @@ int cmd_hostctrl(int argc, char* argv[])
|
|||
struct option long_opts[HOSTCTRL_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(hostctrl_flags, HOSTCTRL_NFLAGS, long_opts,
|
||||
|
|
@ -4607,7 +4607,7 @@ int cmd_upgradeconfig(int argc, char* argv[])
|
|||
struct option long_opts[UPGRADECONFIG_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(upgradeconfig_flags, UPGRADECONFIG_NFLAGS,
|
||||
|
|
@ -4776,7 +4776,7 @@ int cmd_runtasks(int argc, char* argv[])
|
|||
struct option long_opts[RUNTASKS_NFLAGS + 1];
|
||||
char optstring[32];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(runtasks_flags, RUNTASKS_NFLAGS, long_opts,
|
||||
|
|
@ -4979,7 +4979,7 @@ int cmd_setpend(int argc, char* argv[])
|
|||
struct option long_opts[SETPEND_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(setpend_flags, SETPEND_NFLAGS, long_opts,
|
||||
|
|
@ -5175,7 +5175,7 @@ int cmd_jobstart(int argc, char* argv[])
|
|||
struct option long_opts[JOBSTART_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
memset(&info, 0x0, sizeof(info));
|
||||
|
||||
|
|
@ -5286,7 +5286,7 @@ int cmd_jobfinish(int argc, char* argv[])
|
|||
* and the command errors out) — matches the reset convention most other
|
||||
* cmd_ handlers in this file already follow (e.g. cmd_join_worker just
|
||||
* above, cmd_jobsub, cmd_resupdate). */
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
if (flagspec_build_opts(jobfinish_flags, JOBFINISH_NFLAGS, long_opts,
|
||||
|
|
@ -5390,7 +5390,7 @@ int cmd_jobfail(int argc, char* argv[])
|
|||
struct option long_opts[JOBFAIL_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
memset(&failinfo, 0x0, sizeof(failinfo));
|
||||
|
||||
|
|
@ -5732,7 +5732,7 @@ int cmd_resupdate(int argc, char* argv[])
|
|||
struct option long_opts[RESUPDATE_NFLAGS + 1];
|
||||
char optstring[16];
|
||||
|
||||
optind = 1;
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
nres = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,19 @@ extern void test_listfmt_json(void);
|
|||
extern void test_xcetest_process_entry(void);
|
||||
extern void test_test_cli(void);
|
||||
|
||||
/* test_test_cli.c's leak-safety net (see its own comment): reaps and
|
||||
* closes any clitest session left open by a test function that aborted
|
||||
* via a TEST_ASSERT_* failure partway through, before it reached its own
|
||||
* clitest_kill_and_reap()+clitest_close() cleanup. A no-op whenever no
|
||||
* session is currently open (i.e. after every test outside test_test_cli,
|
||||
* and after every test_test_cli sub-test that ran its own cleanup). */
|
||||
extern void clitest_reap_leaked_session(void);
|
||||
|
||||
void setUp(void) { return; }
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
clitest_reap_leaked_session();
|
||||
printf("\n-----------------------------------------------------\n");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -229,6 +229,49 @@ typedef struct {
|
|||
bool reaped;
|
||||
} clitest_session_t;
|
||||
|
||||
/* Leak-safety net: every test function below is expected to end with its
|
||||
* own clitest_kill_and_reap()+clitest_close() calls, but a TEST_ASSERT_*
|
||||
* failure ANYWHERE earlier in the same function longjmp()s straight out
|
||||
* (Unity's TEST_PROTECT() mechanism) -- the rest of the function,
|
||||
* including that inline cleanup, never runs. That leaves the spawned
|
||||
* xce_test child alive (blocked forever on its own prompt, nobody left to
|
||||
* send it input) plus its pty master/stderr-pipe fds open. A mirror is
|
||||
* kept here in STATIC storage rather than tracking a pointer into the
|
||||
* aborted function's own local `sess` -- that stack frame is unwound by
|
||||
* the longjmp, so a pointer into it would dangle. harness_test.c's
|
||||
* tearDown() -- which Unity guarantees to call after every RUN_TEST(),
|
||||
* pass, fail, or abort -- calls clitest_reap_leaked_session() below to
|
||||
* catch exactly this case. Only one clitest session is ever open at a
|
||||
* time (every test function here declares a single `clitest_session_t`
|
||||
* local), so one mirror slot is enough. */
|
||||
static clitest_session_t g_last_session;
|
||||
|
||||
static void clitest_track_session(const clitest_session_t* sess)
|
||||
{
|
||||
g_last_session = *sess;
|
||||
}
|
||||
|
||||
/* Called from harness_test.c's tearDown(). A no-op on the normal path,
|
||||
* where clitest_kill_and_reap()+clitest_close() (below) have already
|
||||
* synced g_last_session back to all-zero before this runs. */
|
||||
void clitest_reap_leaked_session(void)
|
||||
{
|
||||
if (g_last_session.pid <= 0) {
|
||||
return;
|
||||
}
|
||||
if (!g_last_session.reaped) {
|
||||
kill(g_last_session.pid, SIGKILL);
|
||||
waitpid(g_last_session.pid, NULL, 0);
|
||||
}
|
||||
if (g_last_session.master_fd >= 0) {
|
||||
close(g_last_session.master_fd);
|
||||
}
|
||||
if (g_last_session.err_fd >= 0) {
|
||||
close(g_last_session.err_fd);
|
||||
}
|
||||
memset(&g_last_session, 0, sizeof(g_last_session));
|
||||
}
|
||||
|
||||
/* clitest_spawn_ex - capability 1 (parameterized): forks and execs `path`
|
||||
* (argv[0] conventionally the program name, NULL-terminated) with:
|
||||
* - a genuine pty pair on the child's stdin+stdout (openpty(), <pty.h>),
|
||||
|
|
@ -340,6 +383,7 @@ static int clitest_spawn_ex(clitest_session_t* sess, const char* path,
|
|||
sess->master_fd = master_fd;
|
||||
sess->err_fd = errpipe[0];
|
||||
sess->reaped = false;
|
||||
clitest_track_session(sess);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -546,6 +590,9 @@ static void clitest_kill_and_reap(clitest_session_t* sess)
|
|||
kill(sess->pid, SIGKILL);
|
||||
waitpid(sess->pid, &status, 0);
|
||||
sess->reaped = true;
|
||||
if (g_last_session.pid == sess->pid) {
|
||||
g_last_session.reaped = true;
|
||||
}
|
||||
}
|
||||
|
||||
static void clitest_close(clitest_session_t* sess)
|
||||
|
|
@ -558,6 +605,9 @@ static void clitest_close(clitest_session_t* sess)
|
|||
close(sess->err_fd);
|
||||
sess->err_fd = -1;
|
||||
}
|
||||
if (g_last_session.pid == sess->pid) {
|
||||
memset(&g_last_session, 0, sizeof(g_last_session));
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue