Skip to content

feat(xim): custom index artifact sources with git fallback (#377); compact git CA pin (#378) - #379

Merged
Sunrisepeak merged 9 commits into
mainfrom
feat/issue377-custom-index-artifact
Jul 22, 2026
Merged

Sunrisepeak merged 9 commits into
mainfrom
feat/issue377-custom-index-artifact

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Summary

#377 — user-defined index repos can now declare their own artifact source. The artifact pipeline (pointer → sha256-pinned tarball → atomic swap → .xlings-index-version) was always source-agnostic; only two things hard-wired it to the official index: URL construction (single global xim-index repo) and the isDefaultOfficial gate. This PR parameterizes both:

"index_repos": [{
  "name": "mcpplibs",
  "url":  "https://github.com/mcpp-community/mcpp-index.git",   // git fallback
  "artifact": "https://github.com/xlings-res/mcpp-index",       // string or {"GLOBAL":..,"CN":..}
  "source": "auto"                                              // auto | artifact | git
}]
  • ArtifactSource (indexfetch): forge bases (github/gitcode → raw pointer + releases/download/v<ver>/ assets) and flat bases (plain http(s) / file:// / local dir → <base>/<file>); pointer cache keyed per base; manifest key = repo name with sole-entry fallback (custom sources only — the official combined pointer stays exact-match).
  • Gate relaxed to isDefaultOfficial || hasArtifactSource; per-repo source overrides the global mode; all three sync loops (global main-list, global subs, project) route through one artifact-first + git-fallback helper. Covers both real mcpp paths (registry global list + per-project indices).
  • xim-indexrepos.json gains a backward/forward-compatible object form for artifact repos.
  • Repos without artifact are byte-identical to before; official index path unchanged.

#378 — the git fallback now survives Debian/Ubuntu CA layouts. compact::git execs the binary directly and bypasses the xvm shim, so xim-pkgindex#406's env injection never reaches index sync. ensure_available() now pins GIT_SSL_CAINFO to the host bundle when /etc/ssl/cert.pem (the static build's baked-in default) is absent; explicit user/CI settings always win.

Producer side needs nothing new: xlings-res/mcpp-index (pointer + v<sha> releases) is already byte-compatible — verified against release v2e23e20.

Bumps 0.4.67 → 0.4.68. Refs .agents/docs/2026-07-22-issue377-custom-index-artifact-design.md.

Closes #377, Closes #378

Testing

  • Unit: 4 CA-bundle tests, 4 parser tests, 11 ArtifactSource/select_manifest/URL tests, 5 gate/persistence tests — all green via mcpp test.
  • E2E-30 (custom_index_artifact_test.sh, hermetic): A artifact-only w/ dead git URL · B sole-entry key fallback · C auto fallback past broken base · D git→artifact migration · E source:"git" ignores artifact. Plus neighbor regression: index_artifact_update_test.sh, interface_multi_repo_error_visibility_test.sh.

@Sunrisepeak
Sunrisepeak merged commit d9338f5 into main Jul 22, 2026
7 checks passed
Sunrisepeak added a commit that referenced this pull request Jul 22, 2026
…tion) (#380)

setup_envs blindly PATH-appended every vdata env; when compact::git's CA pin (#378) and xim git.lua envs (xim-pkgindex#406) resolve the same bundle path, GIT_SSL_CAINFO became 'x:x' and every HTTPS git transport died. Extract pure merge_shim_env_value: prepend genuinely new components, no-op when already present. Verified end-to-end on a Debian-layout host. Follow-up to #379 (0.4.68).
Sunrisepeak added a commit that referenced this pull request Jul 27, 2026
From the e2e job on main:

    === E2E-30: custom_index_artifact_test.sh ===
    [test] SKIP: no xlings binary (build first)
    PASS: E2E-30 (custom_index_artifact_test.sh, 7ms)

`custom_index_artifact_test.sh` and `index_artifact_update_test.sh` each
rolled their own binary discovery — `find "$PROJECT_DIR/build" -path
'*debug*' -name xlings` — with a SKIP and exit 0 when nothing matched.
It lied in both directions:

  * run_all.sh passes no argument to E2E-30, and CI builds into target/
    via mcpp, never build/. So the find matched nothing, the test
    skipped, and run_all recorded a pass. The custom index artifact
    feature (#377/#379, shipped 0.4.68) has had no CI coverage at all
    while appearing to have it.

  * Standalone on a dev box the find DID match — a three-week-old debug
    build — so the test failed against behaviour that had since changed,
    which reads as a product bug and is not one.

Both now use find_xlings_bin: newest build under target/, with the
version-mismatch warning. Its comment already records the cost of
getting this wrong once. And "no binary" is now a failure, not a skip —
a test that cannot find what it tests has not tested it.

Both pass with real assertions. index_artifact_update_test.sh was also
unregistered, so it is now E2E-41.
Sunrisepeak added a commit that referenced this pull request Jul 27, 2026
…tests (#426)

* test(e2e): stop pinning the profile version, and run the two upgrade tests

`subos_profile_upgrade_test.sh` and `subos_shell_level_test.sh` both
grep for `# xlings-profile-version: 9`. The profiles moved to 10 (see
core/xself/profile_resources.cppm), so both have been failing — and
neither is listed in run_all.sh, so nothing noticed.

Read the expected marker out of profile_resources.cppm instead. What
these tests are for is "the emitted profile carries the marker the
source declares"; the number it happens to be today is not part of
that, and pinning it is what let them rot.

Register both. `subos_profile_upgrade_test.sh` is literally the
profile-upgrade test and it has never run in CI.

Found while evaluating the 0.4.69 -> 2026.7.27.3 upgrade path. 18 of
the 73 e2e scripts are referenced from neither run_all.sh nor
project_e2e_test.sh nor any workflow; 16 were run locally and 14 pass
unchanged. Whether to wire up the other 14 is a separate call about CI
time, so the list is in an issue rather than in this commit.

* test(e2e): E2E-30 was reporting PASS in 7ms without running

From the e2e job on main:

    === E2E-30: custom_index_artifact_test.sh ===
    [test] SKIP: no xlings binary (build first)
    PASS: E2E-30 (custom_index_artifact_test.sh, 7ms)

`custom_index_artifact_test.sh` and `index_artifact_update_test.sh` each
rolled their own binary discovery — `find "$PROJECT_DIR/build" -path
'*debug*' -name xlings` — with a SKIP and exit 0 when nothing matched.
It lied in both directions:

  * run_all.sh passes no argument to E2E-30, and CI builds into target/
    via mcpp, never build/. So the find matched nothing, the test
    skipped, and run_all recorded a pass. The custom index artifact
    feature (#377/#379, shipped 0.4.68) has had no CI coverage at all
    while appearing to have it.

  * Standalone on a dev box the find DID match — a three-week-old debug
    build — so the test failed against behaviour that had since changed,
    which reads as a product bug and is not one.

Both now use find_xlings_bin: newest build under target/, with the
version-mismatch warning. Its comment already records the cost of
getting this wrong once. And "no binary" is now a failure, not a skip —
a test that cannot find what it tests has not tested it.

Both pass with real assertions. index_artifact_update_test.sh was also
unregistered, so it is now E2E-41.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant