Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .agents/reports/pr32-ci-checkout-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# PR 32 CI: restore bao-tree checkout on a legal path

**Date:** 2026-08-13
**Workspace:** `/home/hunter/Projects/surmount/carbonado`
**HEAD (committed YAML still had the illegal sibling checkout):** `b8c070ae64da98a9a2743dfdb48e8f75322b4f93`

## What changed

The previous working-tree change deleted all six `actions/checkout` steps that fetch bao-tree. That is reversed.

Every job that had **Checkout bao-tree keyed fork (sibling for path dep)** now has the step again. The path is inside `GITHUB_WORKSPACE`. Cargo is pointed at that tree before any cargo/just step.

`git diff HEAD -- .github/workflows/rust.yaml` is a restore-and-rewire (repo/ref/path + a patch step), not a net deletion of the checkout feature.

## In-workspace path

| Field | Old (illegal) | New |
|-------|---------------|-----|
| `repository` | `SurmountSystems/bao-tree` | `n0-computer/bao-tree` |
| `ref` | `76-keyed-bao` | `keyed-bao` |
| `path` | `../bao-tree` | `bao-tree` |

`path: bao-tree` is `${GITHUB_WORKSPACE}/bao-tree`, i.e. `/home/runner/work/carbonado/carbonado/bao-tree`. `actions/checkout@v4` accepts that.

Product `Cargo.toml` already uses `git = "https://github.com/n0-computer/bao-tree.git"`, `branch = "keyed-bao"`. The checkout matches that source, not the SurmountSystems `76-keyed-bao` sibling used only by local `just setup-bao-tree`.

Local optional path is unchanged: `just setup-bao-tree` / `.cargo/config.toml.example` still talk about `../bao-tree`.

`/bao-tree` is gitignored so an in-workspace clone is not committed.

## How cargo is patched (CI-only)

Committed `.cargo/config.toml` still only has the bitcoinpqc `[patch.crates-io]` block. That file is not overwritten.

Each job, after the bao-tree checkout, runs the composite
`.github/actions/ci-patch-bao-tree`. That step:

1. Fail-closes unless `${GITHUB_WORKSPACE}/bao-tree/Cargo.toml` exists.
2. **Appends** (does not replace) this table to `.cargo/config.toml`:

```toml
[patch."https://github.com/n0-computer/bao-tree.git"]
bao-tree = { path = "${GITHUB_WORKSPACE}/bao-tree" }
```

The path is absolute so it does not depend on whether cargo resolves patch paths relative to `.cargo/` or the workspace root. The git URL matches `Cargo.toml` exactly. The bitcoinpqc patch stays in place.

This append is job-local. It is not committed. Developers without a sibling or in-workspace tree keep using the public git dep.

## Jobs covered

Same six jobs as `git show HEAD:.github/workflows/rust.yaml`:

| Job | Checkout restored | Patch before cargo |
|-----|-------------------|--------------------|
| `lint` | yes | yes (before `just fmt` / `just lint`) |
| `lint-wasm` | yes | yes (before `just lint-wasm`) |
| `desktop` | yes | yes (before `cargo test` / just) |
| `test-matrix` | yes | yes (before `cargo check`) |
| `web-check` | yes | yes (before `cargo check`) |
| `dual-backend-lean` | yes | yes (before nix + `just test-lean-ci`) |

No `--all-features`. Tests were not weakened. No commit or push.

## Process note

This L2 session could not launch a workflow (host: workflows only from a top-level session). Inventory used `git show HEAD:.github/workflows/rust.yaml`, `Cargo.toml`, `.cargo/config.toml`, `.cargo/config.toml.example`, and `justfile`.
54 changes: 54 additions & 0 deletions .agents/reports/pr32-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# PR 32 CI diagnosis

**PR:** https://github.com/bitmask-stack/carbonado/pull/32
**Branch:** `lean` → `main` (draft, title “proven”)
**HEAD:** `b8c070ae64da98a9a2743dfdb48e8f75322b4f93`
**Date observed:** 2026-08-13

## What ran

Workflows are not skipped, pending forever, or missing. One workflow exists (`Rust` / `.github/workflows/rust.yaml`). Both the `push` run ([101](https://github.com/bitmask-stack/carbonado/actions/runs/31745640857)) and the `pull_request` run ([102](https://github.com/bitmask-stack/carbonado/actions/runs/31745690786)) completed in about ten seconds as **failure**. Combined commit status is `pending` with **zero** commit statuses. That is normal: this repo uses Actions check runs, not the old status API.

| Check name | Conclusion | Why |
|------------|------------|-----|
| `lint` | **failure** | Illegal sibling checkout (below) |
| `lint-wasm` | **failure** | Same |
| `desktop` | skipped | `needs: lint` |
| `test-matrix` | skipped | `needs: lint` |
| `dual-backend-lean` | skipped | `needs: lint` |
| `web-check` | skipped | `needs: lint-wasm` |

Job names match `docs/TEST_CONTRACT.md` (`desktop`, `dual-backend-lean`, plus lint/matrix). This is not a branch-protection name mismatch. There are no PR comments about CI. Rustc, clippy, and tests never started.

## Root cause

Every job checked out `SurmountSystems/bao-tree` at `76-keyed-bao` with `path: ../bao-tree`. `actions/checkout@v4` refuses any path outside `GITHUB_WORKSPACE`.

Quoted from `lint` / `lint-wasm` on run 102:

```
Repository path '/home/runner/work/carbonado/bao-tree' is not under '/home/runner/work/carbonado/carbonado'
```

Failed step: **Checkout bao-tree keyed fork (sibling for path dep)**.

That step is leftover from an optional local path patch (`just dev-local-bao` / `.cargo/config.toml.example`). CI does not copy that example. Product `Cargo.toml` already uses a public git dep:

`git+https://github.com/n0-computer/bao-tree.git?branch=keyed-bao` (lock pin `e82e744…`; branch is public).

Committed `.cargo/config.toml` only patches `bitcoinpqc` to a public git rev. It does **not** force `../bao-tree`. So CI does not need a sibling checkout.

Local `just check` looks fine because it never runs `actions/checkout`. Same illegal step already fails `main` the same way (run 99, 2026-07-09).

Not the cause: YAML syntax, path filters, permissions, n0-computer fetch (never reached), dual-backend `--all-features` (PR already avoids that).

## Fix applied (not committed, not pushed)

Removed all six sibling `actions/checkout` steps from [`.github/workflows/rust.yaml`](../../.github/workflows/rust.yaml) and left a short comment. Cargo on CI will fetch `n0-computer/bao-tree` `keyed-bao` as `Cargo.toml` already says.

After this file is on `lean`, re-run the PR workflow. Later jobs may still fail on real compile/test; this change only unblocks the first step.

## Residual (not this outage)

- `keyed-bao` is a moving branch; `/Cargo.lock` is gitignored, so CI is not pinned to a lockfile.
- `just setup-bao-tree` still clones `SurmountSystems` `76-keyed-bao`. Local optional path patch vs product git source can drift. Separate from this CI break.
14 changes: 13 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# TEMPORARY — remove on or after 2026-07-18.
# This directory's `.cargo/config.toml` is closer than `~/.cargo`, so it
# overrides menhera-cooldown for this repo only. Do not edit ~/.cargo.
#
# Nix crane vendors crates.io and would lose if this replace-with stayed in
# the sandbox. `nix/cargo-quality.nix` strips the two tables below on unpack.
#
# TEMPORARY bitcoinpqc patch — remove on or after 2026-07-18.
#
# `bitcoinpqc` 0.4.0 (published 2026-07-08) may not be on mirrored registries yet.
# This patch satisfies `version = "0.4"` until mirrors sync (target lift: 2026-07-18).
Expand All @@ -10,6 +16,12 @@
#
# Environments that already see `bitcoinpqc` 0.4 on the default index may delete early.

[registries.crates-io-official]
index = "sparse+https://index.crates.io/"

[source.crates-io]
replace-with = "crates-io-official"

[patch.crates-io]
bitcoinpqc = { git = "https://github.com/cryptoquick/libbitcoinpqc-bindings.git", rev = "7936b56" }
# Monorepo local iteration (optional): `bitcoinpqc = { path = "../libbitcoinpqc-bindings" }`
6 changes: 3 additions & 3 deletions .cargo/config.toml.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Optional local development overrides (copy to `.cargo/config.toml`).
#
# Faster iteration: use a sibling checkout of the keyed bao-tree fork instead of
# fetching from git on every clean build.
# Faster iteration: use a sibling checkout of n0-computer/bao-tree 0.16.1
# (see just setup-bao-tree) instead of crates.io on every clean build.
#
# just setup-bao-tree
# cp .cargo/config.toml.example .cargo/config.toml

[patch."https://github.com/SurmountSystems/bao-tree.git"]
[patch.crates-io]
bao-tree = { path = "../bao-tree" }

# `bitcoinpqc` 0.4 mirror lag: the repo ships `.cargo/config.toml` with a temporary
Expand Down
35 changes: 35 additions & 0 deletions .github/actions/ci-patch-bao-tree/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Patch cargo to workspace bao-tree
description: >
Append a CI-only [patch] so cargo uses the in-workspace bao-tree checkout.
Does not overwrite the committed bitcoinpqc crates-io patch.

runs:
using: composite
steps:
- name: Append bao-tree path patch
shell: bash
run: |
set -euo pipefail
cfg=".cargo/config.toml"
dest="${GITHUB_WORKSPACE}/bao-tree"
mkdir -p .cargo
if [[ ! -f "${dest}/Cargo.toml" ]]; then
echo "bao-tree checkout missing at ${dest} (expected path: bao-tree)"
exit 1
fi
if [[ ! -f "${cfg}" ]]; then
echo "expected committed ${cfg} (bitcoinpqc patch); creating empty"
: > "${cfg}"
fi
if grep -Fq '[patch."https://github.com/n0-computer/bao-tree.git"]' "${cfg}"; then
echo "bao-tree cargo patch already present in ${cfg}"
else
{
printf '\n'
printf '[patch."https://github.com/n0-computer/bao-tree.git"]\n'
printf 'bao-tree = { path = "%s" }\n' "${dest}"
} >> "${cfg}"
echo "appended bao-tree path patch -> ${dest}"
fi
echo "---- ${cfg} ----"
cat "${cfg}"
Loading
Loading