Skip to content

Commit 257d188

Browse files
committed
Merge first five upstream milestones with native CLI adaptations
2 parents 327dccc + 4d8ac9e commit 257d188

13 files changed

Lines changed: 346 additions & 77 deletions

‎BACKLOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Backlog
22

3+
## Five-slice upstream merge trial — 2026-10-03
4+
5+
- [ ] Validate and integrate the first five upstream PR milestones through
6+
`4d8ac9e1cea0d645a02f876f47536c54a5bfa406`. Isolated merge source is reconciled:
7+
native trace representation, numeric daemon admission logging, EINTR-safe
8+
backoff, native help and registry selector filtering. Three branch-sync merges
9+
accompany five PR merges/five non-merges (13 ancestry commits total).
10+
Full Jenkins validation, main integration and origin push remain pending.
11+
Canonical full-hash dispositions and acceptance are in the 308 audit's
12+
“Five-slice upstream ancestry trial” section; evidence is in the existing
13+
CBM-UPSTREAM-SOL-20261002-R2 run's `five-slice-merge-trial/` directory.
14+
15+
316
## Resolved
417

518
- [x] Release-tooling implements deferred npm/PyPI/public publication,

‎docs/UPSTREAM_308_CANDIDATE_AUDIT_20260912.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
# Upstream merge progress — canonical ledger
22

3+
## Five-slice upstream ancestry trial — 2026-10-03
4+
5+
The user authorized a trial of five upstream verticals, followed by release-tooling
6+
integration, a main merge and an origin push only after successful validation.
7+
The trial starts at release-tooling `327dccc04d749892dddf19ca4dc62bf28a5131c8`
8+
and merges upstream milestone `4d8ac9e1cea0d645a02f876f47536c54a5bfa406`.
9+
It includes exactly five first-parent PR merges, five non-merge constituents and
10+
three branch-sync merges: **13 upstream ancestry commits**, not thirteen new features.
11+
The full-hash constituent receipt and source/graph/Jev evidence are under the
12+
existing run evidence directory `five-slice-merge-trial/`.
13+
14+
| Vertical | Upstream PR merge | Non-merge constituent | Trial disposition and acceptance |
15+
| --- | --- | --- | --- |
16+
| Trace evidence ordering | `5fbab7bb7332bd06aaa880653ddfb2696e648f90` | `0106ff5d9933b9bd65eba393a998586e219da7bd` | MCP transport remains deleted. Native CLI `src/operations/trace.c:leg_json` already emits strategy/confidence before args in both header and rows and forwards include_evidence in both directions. This source representation does not claim MCP transport equivalence. |
17+
| Numeric auto-index limit logging | `b44e58490f11e4ee895dd91c02067b6de59cdf96` | `dc24d5813081ba7f4f1cb282cd9e10b8ac963eb7` | Adapt warning to native `src/daemon/application.c`: log numeric configured limit with tracked-file count. Extended `daemon_application_auto_index_honors_tracked_file_limit` requires actual skipped admission and files=1/limit=0 log. |
18+
| Interrupted spawn backoff | `1424934980d353f97c3664f07b2c1721792b7efa` | `c537bf0f8b3b6a77e39df49fec78560b5e8e87b7` | Merge `cbm_nanosleep_full` into compat, use it from subprocess backoff. Retain thread CPU API. Upstream registered POSIX signal regression requires delivered signals, full delay and clean subprocess outcome; Windows remains platform-specific. |
19+
| Client selector help | `c895513f2d6821a3479ea4cbdcf8a39cee2f33ba` | `1e0aac527b016d519eb7f8fc7dd610dbeb66e988` | Add install --clients discovery to native CLI help while preserving native commands/product identity. |
20+
| Registry client selection | `4d8ac9e1cea0d645a02f876f47536c54a5bfa406` | `1e25d962d69999438229b0562d44ea60e97f5456` | Filter registry display/install paths, expose stable registry vocabulary, reject unknown selectors. Adapt regression from removed MCP settings to actual Qoder CLI skill: cursor excludes Qoder artifact, qoder installs it. Retain scoped config-follow behavior. |
21+
22+
Branch-sync constituents: `3a500bc8450ab78969d1d8cb4b12e55a479b68d7`,
23+
`359f7360ddd39dc155637076e76a4e855c27611f`,
24+
`98e386e58b753bcf63f67aeeacbfcb94961d035c`. Their changes are included in the
25+
milestone tree comparison; they are not separately credited as functionality.
26+
27+
The isolated trial resolves five conflict paths. MCP source/tests stay deleted;
28+
shared fixes and native adaptations remain. Exact-worktree CBM full indexing
29+
completed with ready root; flagged parse-partial paths use exact source fallback.
30+
Only formatting and git diff checks ran locally. The full Jenkins gate is pending;
31+
there is no runtime acceptance, main integration or push yet. Jev-1.13.0 source
32+
advice: consistent 0.65 / defect 0.30 / insufficient 0.05; Qoder skill regression
33+
applicable 0.77 / inapplicable 0.22 / insufficient 0.01. Source inspection and Jenkins
34+
retain authority. The preceding ten-task source confirmation is separate.
35+
36+
If integrated, this milestone reduces the frozen upstream ancestry difference
37+
from 678 to 665. It does not resolve the global semantic audit remainder.
38+
39+
340
This is the single canonical document for upstream merge work in this
441
repository. The filename is retained for stable links; the old 308-commit
542
snapshot and the separate dated plan documents are superseded by this ledger.

‎docs/UPSTREAM_RECONCILIATION_REPORT_20261002.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
# Upstream reconciliation evidence report — 2026-10-02
22

3+
## Five-slice upstream ancestry trial — 2026-10-03
4+
5+
The user authorized a trial of five upstream verticals, followed by release-tooling
6+
integration, a main merge and an origin push only after successful validation.
7+
The trial starts at release-tooling `327dccc04d749892dddf19ca4dc62bf28a5131c8`
8+
and merges upstream milestone `4d8ac9e1cea0d645a02f876f47536c54a5bfa406`.
9+
It includes exactly five first-parent PR merges, five non-merge constituents and
10+
three branch-sync merges: **13 upstream ancestry commits**, not thirteen new features.
11+
The full-hash constituent receipt and source/graph/Jev evidence are under the
12+
existing run evidence directory `five-slice-merge-trial/`.
13+
14+
| Vertical | Upstream PR merge | Non-merge constituent | Trial disposition and acceptance |
15+
| --- | --- | --- | --- |
16+
| Trace evidence ordering | `5fbab7bb7332bd06aaa880653ddfb2696e648f90` | `0106ff5d9933b9bd65eba393a998586e219da7bd` | MCP transport remains deleted. Native CLI `src/operations/trace.c:leg_json` already emits strategy/confidence before args in both header and rows and forwards include_evidence in both directions. This source representation does not claim MCP transport equivalence. |
17+
| Numeric auto-index limit logging | `b44e58490f11e4ee895dd91c02067b6de59cdf96` | `dc24d5813081ba7f4f1cb282cd9e10b8ac963eb7` | Adapt warning to native `src/daemon/application.c`: log numeric configured limit with tracked-file count. Extended `daemon_application_auto_index_honors_tracked_file_limit` requires actual skipped admission and files=1/limit=0 log. |
18+
| Interrupted spawn backoff | `1424934980d353f97c3664f07b2c1721792b7efa` | `c537bf0f8b3b6a77e39df49fec78560b5e8e87b7` | Merge `cbm_nanosleep_full` into compat, use it from subprocess backoff. Retain thread CPU API. Upstream registered POSIX signal regression requires delivered signals, full delay and clean subprocess outcome; Windows remains platform-specific. |
19+
| Client selector help | `c895513f2d6821a3479ea4cbdcf8a39cee2f33ba` | `1e0aac527b016d519eb7f8fc7dd610dbeb66e988` | Add install --clients discovery to native CLI help while preserving native commands/product identity. |
20+
| Registry client selection | `4d8ac9e1cea0d645a02f876f47536c54a5bfa406` | `1e25d962d69999438229b0562d44ea60e97f5456` | Filter registry display/install paths, expose stable registry vocabulary, reject unknown selectors. Adapt regression from removed MCP settings to actual Qoder CLI skill: cursor excludes Qoder artifact, qoder installs it. Retain scoped config-follow behavior. |
21+
22+
Branch-sync constituents: `3a500bc8450ab78969d1d8cb4b12e55a479b68d7`,
23+
`359f7360ddd39dc155637076e76a4e855c27611f`,
24+
`98e386e58b753bcf63f67aeeacbfcb94961d035c`. Their changes are included in the
25+
milestone tree comparison; they are not separately credited as functionality.
26+
27+
The isolated trial resolves five conflict paths. MCP source/tests stay deleted;
28+
shared fixes and native adaptations remain. Exact-worktree CBM full indexing
29+
completed with ready root; flagged parse-partial paths use exact source fallback.
30+
Only formatting and git diff checks ran locally. The full Jenkins gate is pending;
31+
there is no runtime acceptance, main integration or push yet. Jev-1.13.0 source
32+
advice: consistent 0.65 / defect 0.30 / insufficient 0.05; Qoder skill regression
33+
applicable 0.77 / inapplicable 0.22 / insufficient 0.01. Source inspection and Jenkins
34+
retain authority. The preceding ten-task source confirmation is separate.
35+
36+
If integrated, this milestone reduces the frozen upstream ancestry difference
37+
from 678 to 665. It does not resolve the global semantic audit remainder.
38+
39+
340
**The history inventory is complete; the semantic audit is partial.** This report
441
collects the Sol source audit, Luna handoffs, corrections, QA delta and remaining
542
limits. It is a dated synthesis, subordinate to [BACKLOG.md](../BACKLOG.md) and

‎src/cli/cli.c‎

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7076,6 +7076,12 @@ static const char *detect_arch(void) {
70767076

70777077
/* ── Agent config install/refresh (shared by install + update) ── */
70787078

7079+
/* Set by `install --clients=...` after validation and consumed by both the
7080+
* legacy detector and the registry-backed client path (#1558, #1798). */
7081+
static const char *g_client_selection = NULL;
7082+
static bool cli_clients_apply_selection(const char *spec, cbm_detected_agents_t *detected);
7083+
static bool cli_clients_selects_registry_client(const char *spec, cbm_agent_client_id_t client_id);
7084+
static void cli_clients_print_list(FILE *out);
70797085
static void print_detected_registry_agents(const char *home, bool *any);
70807086

70817087
/* Print detected agent names on a single line. */
@@ -7699,7 +7705,10 @@ static void print_detected_registry_agents(const char *home, bool *any) {
76997705
cbm_init_agent_registry_context(home, &registry);
77007706
for (size_t index = 0U; index < cbm_agent_client_count(); index++) {
77017707
const cbm_agent_client_profile_t *profile = cbm_agent_client_at(index);
7702-
if (profile && cbm_agent_client_detect(profile->id, &registry.options)) {
7708+
if (profile &&
7709+
(!g_client_selection ||
7710+
cli_clients_selects_registry_client(g_client_selection, profile->id)) &&
7711+
cbm_agent_client_detect(profile->id, &registry.options)) {
77037712
printf(" %s", profile->display_name);
77047713
*any = true;
77057714
}
@@ -8012,7 +8021,10 @@ static void install_agent_client_registry(const char *home, const char *binary_p
80128021
cbm_init_agent_registry_context(home, &registry);
80138022
for (size_t index = 0U; index < cbm_agent_client_count(); index++) {
80148023
const cbm_agent_client_profile_t *profile = cbm_agent_client_at(index);
8015-
if (!profile || !cbm_agent_client_detect(profile->id, &registry.options)) {
8024+
if (!profile ||
8025+
(g_client_selection &&
8026+
!cli_clients_selects_registry_client(g_client_selection, profile->id)) ||
8027+
!cbm_agent_client_detect(profile->id, &registry.options)) {
80168028
continue;
80178029
}
80188030
if (!g_install_plan) {
@@ -8636,13 +8648,6 @@ static void install_additional_agent_configs(const cbm_detected_agents_t *agents
86368648
}
86378649
}
86388650

8639-
/* #1558: set by `install --clients=...` after validation, consumed at the one
8640-
* place detection happens. Validation runs in cbm_cmd_install so an unknown
8641-
* token fails before anything is written, not midway through configuring. */
8642-
static const char *g_client_selection = NULL;
8643-
static bool cli_clients_apply_selection(const char *spec, cbm_detected_agents_t *detected);
8644-
static void cli_clients_print_list(FILE *out);
8645-
86468651
static int cbm_install_agent_configs_in_scope(const char *home, const char *binary_path, bool force,
86478652
bool dry_run, cbm_detected_agents_t *agents_in);
86488653

@@ -8790,9 +8795,9 @@ int cbm_install_handle_existing_indexes(const char *home, bool reset, bool dry_r
87908795
* Codex had to revert the OpenCode and Cursor integrations by hand, and the
87918796
* next install silently recreated them. `--clients=claude,codex` restricts it.
87928797
*
8793-
* The table is the flag's vocabulary AND its documentation: 26 clients ship
8794-
* here, with tokens nobody would guess (factory-droid, mistral-vibe,
8795-
* copilot-cli), so `--clients=help` prints every token. A selector whose
8798+
* The tables are the flag's vocabulary AND its documentation, with tokens
8799+
* nobody would guess (factory-droid, mistral-vibe, copilot-cli), so
8800+
* `--clients=help` prints every token. A selector whose
87968801
* accepted values can only be learned from the source is not a usable
87978802
* selector, and an unrecognised token fails loudly with the list rather than
87988803
* silently configuring nothing. */
@@ -8841,10 +8846,40 @@ static void cli_clients_print_list(FILE *out) {
88418846
for (size_t i = 0; i < CLI_CLIENT_COUNT; i++) {
88428847
(void)fprintf(out, " %-16s %s\n", CLI_CLIENTS[i].token, CLI_CLIENTS[i].display);
88438848
}
8849+
for (size_t i = 0; i < cbm_agent_client_count(); i++) {
8850+
const cbm_agent_client_profile_t *profile = cbm_agent_client_at(i);
8851+
if (profile) {
8852+
(void)fprintf(out, " %-16s %s\n", profile->stable_id, profile->display_name);
8853+
}
8854+
}
88448855
(void)fprintf(out, "\nExample: --clients=claude,codex\n"
88458856
"Omit --clients to configure every detected client.\n");
88468857
}
88478858

8859+
static bool cli_clients_spec_contains(const char *spec, const char *wanted_token) {
8860+
char buf[CLI_BUF_1K];
8861+
snprintf(buf, sizeof(buf), "%s", spec ? spec : "");
8862+
char *save = NULL;
8863+
for (char *tok = strtok_r(buf, ",", &save); tok; tok = strtok_r(NULL, ",", &save)) {
8864+
while (*tok == ' ') {
8865+
tok++;
8866+
}
8867+
size_t len = strlen(tok);
8868+
while (len > 0 && tok[len - 1] == ' ') {
8869+
tok[--len] = '\0';
8870+
}
8871+
if (strcmp(tok, wanted_token) == 0) {
8872+
return true;
8873+
}
8874+
}
8875+
return false;
8876+
}
8877+
8878+
static bool cli_clients_selects_registry_client(const char *spec, cbm_agent_client_id_t client_id) {
8879+
const cbm_agent_client_profile_t *profile = cbm_agent_client_by_id(client_id);
8880+
return profile && cli_clients_spec_contains(spec, profile->stable_id);
8881+
}
8882+
88488883
/* Restrict `detected` to the comma-separated token list. Returns false (after
88498884
* printing the vocabulary) when a token is unknown, so a typo can never be
88508885
* mistaken for "that client was not installed". */
@@ -8873,6 +8908,9 @@ static bool cli_clients_apply_selection(const char *spec, cbm_detected_agents_t
88738908
break;
88748909
}
88758910
}
8911+
if (!matched) {
8912+
matched = cbm_agent_client_by_stable_id(tok) != NULL;
8913+
}
88768914
if (!matched) {
88778915
(void)fprintf(stderr, "error: unknown client: %s\n\n", tok);
88788916
cli_clients_print_list(stderr);
@@ -8898,6 +8936,9 @@ size_t cbm_cli_clients_count_for_testing(void) {
88988936
const char *cbm_cli_clients_token_for_testing(size_t index) {
88998937
return index < CLI_CLIENT_COUNT ? CLI_CLIENTS[index].token : NULL;
89008938
}
8939+
void cbm_cli_set_client_selection_for_testing(const char *spec) {
8940+
g_client_selection = spec;
8941+
}
89018942
#endif
89028943

89038944
/* ── Subcommand: install ──────────────────────────────────────── */
@@ -9340,7 +9381,7 @@ int cbm_cmd_install(int argc, char **argv) {
93409381
}
93419382
} else if (strcmp(argv[i], "--clients") == 0) {
93429383
/* Bare `--clients` (and `--clients=help`/`list`) print the
9343-
* vocabulary. 26 clients ship with tokens nobody would guess. */
9384+
* vocabulary, including tokens users would not readily guess. */
93449385
cli_clients_print_list(stdout);
93459386
return 0;
93469387
} else if (strcmp(argv[i], "--skip-binary") == 0) {

‎src/cli/cli.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ int cbm_install_agent_hooks_for_testing(const char *home, const char *binary_pat
190190
bool cbm_cli_clients_apply_selection_for_testing(const char *spec, cbm_detected_agents_t *detected);
191191
size_t cbm_cli_clients_count_for_testing(void);
192192
const char *cbm_cli_clients_token_for_testing(size_t index);
193+
void cbm_cli_set_client_selection_for_testing(const char *spec);
193194
#endif
194195

195196
#ifdef CBM_CLI_ENABLE_TEST_API

‎src/daemon/application.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1970,10 +1970,12 @@ static void application_background_initialize_impl(cbm_daemon_application_sessio
19701970
cbm_auto_index_within_file_limit(root_path, auto_index_limit, &tracked_files);
19711971
if (auto_index_candidate && !within_auto_index_limit) {
19721972
char files[32];
1973+
char limit[32];
19731974
(void)snprintf(files, sizeof(files), "%d", tracked_files);
1975+
(void)snprintf(limit, sizeof(limit), "%d", auto_index_limit);
19741976
cbm_log_warn("daemon.autoindex.skipped", "project", project, "reason",
19751977
tracked_files >= 0 ? "too_many_files" : "unsafe_or_unavailable_path", "files",
1976-
files);
1978+
files, "limit", limit);
19771979
}
19781980
bool args_required = auto_index_candidate && within_auto_index_limit;
19791981
char *args = args_required ? application_auto_index_args(root_path) : NULL;

‎src/foundation/compat.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@
1717
#include <sys/stat.h>
1818
#endif
1919

20+
int cbm_nanosleep_full(const struct timespec *req) {
21+
#ifdef _WIN32
22+
return cbm_nanosleep(req, NULL);
23+
#else
24+
struct timespec remaining = *req;
25+
while (nanosleep(&remaining, &remaining) != 0) {
26+
if (errno != EINTR) {
27+
return -1;
28+
}
29+
}
30+
return 0;
31+
#endif
32+
}
33+
2034
/* ── strndup (Windows lacks it) ───────────────────────────────── */
2135

2236
#ifdef _WIN32

‎src/foundation/compat.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ static inline int cbm_nanosleep(const struct timespec *req, struct timespec *rem
9999

100100
/* Per-calling-thread CPU time in nanoseconds. */
101101
uint64_t cbm_thread_cpu_time_ns(void);
102+
/* Sleeps for the full requested duration even when POSIX signals interrupt it. */
103+
int cbm_nanosleep_full(const struct timespec *req);
102104

103105
/* ── gmtime_r (Windows lacks it) ─────────────────────────────── */
104106
#ifdef _WIN32

‎src/foundation/subprocess.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static void cbm_spawn_backoff(int attempt) {
970970
int shift = attempt < CBM_SPAWN_BACKOFF_MAX_SHIFT ? attempt : CBM_SPAWN_BACKOFF_MAX_SHIFT;
971971
long ms = (long)CBM_SPAWN_BACKOFF_BASE_MS << shift;
972972
struct timespec delay = {ms / 1000L, (ms % 1000L) * 1000L * 1000L};
973-
(void)cbm_nanosleep(&delay, NULL);
973+
(void)cbm_nanosleep_full(&delay);
974974
}
975975

976976
/* fork() fails with EAGAIN under the same pressure posix_spawn does, and the

‎src/main.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,8 @@ static void print_help(void) {
10831083
printf(" codebase-memory-cli allow-root [--approve-sensitive] <path>\n");
10841084
printf(" codebase-memory-cli install [-y|-n] [--force] [--dry-run] [--dir=<path>] "
10851085
"[--skip-config]\n");
1086+
printf(" [--clients=<tokens>] Run "
1087+
"'install --clients' to list tokens\n");
10861088
printf(" codebase-memory-cli install-hooks [--dry-run] [--plan] [--clients=<list>]\n");
10871089
printf(" codebase-memory-cli uninstall [-y|-n] [--dry-run]\n");
10881090
printf(" codebase-memory-cli update [-y|-n]\n");

0 commit comments

Comments
 (0)