Skip to content

Commit 2927646

Browse files
committed
chore: merge main into vishwa/cedar-openshell
Bring the branch up to date with main (c4688aa). The Windows test repairs on main (92434dc) cover the same tests this branch had stabilized, so the conflicts resolve to main's versions: the mutation guard stress test yields until its deadline instead of counting yields, and the startup write-refusal scenarios gate baseline enrichment on Unix with main's wording. The `PolicySource` import that resolution needs is restored. Refs #4474 Signed-off-by: Vishwanath Raman <[email protected]>
2 parents 1bd37b1 + c4688aa commit 2927646

46 files changed

Lines changed: 479 additions & 119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/create-github-pr/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Create pull requests on GitHub using the `gh` CLI.
1313

1414
- The `gh` CLI must be authenticated (`gh auth status`)
1515
- You must have commits on a branch that's pushed to the remote
16-
- Every PR must close an existing issue, except automated dependency updates as described in `CONTRIBUTING.md`. Follow Branch Names in `CONTRIBUTING.md` for contributor branch names.
16+
- Every PR must close an existing issue, except automated dependency updates and build or flaky-test fixes from authors with write access, as described in `CONTRIBUTING.md`. Follow Branch Names in `CONTRIBUTING.md` for contributor branch names.
1717

1818
## Before Creating a PR
1919

@@ -126,7 +126,7 @@ gh pr create --title "PR title" --body "PR description"
126126

127127
### Link to an Issue
128128

129-
Every PR except an automated dependency update must close its own issue. Verify that the issue exists, remains open, and covers the PR scope. Automated dependency updates follow the exception in `CONTRIBUTING.md`. Use `Closes #<issue-number>` in the body so merge closes it:
129+
Every PR must close its own issue, except automated dependency updates and build or flaky-test fixes from authors with write access; both follow the exceptions in `CONTRIBUTING.md`. A PR without an issue describes the failure it fixes in the Related Issue section. Otherwise, verify that the issue exists, remains open, and covers the PR scope. Use `Closes #<issue-number>` in the body so merge closes it:
130130

131131
```bash
132132
gh pr create \

‎.agents/skills/sync-agent-infra/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Search both `skills/` and `.agents/skills/` for affected commands, fields, and c
4141
2. Compare `crates/` with the architecture table in `AGENTS.md`. Check the public and contributor skill rows.
4242
3. Follow Label Discovery in `CONTRIBUTING.md` to retrieve every page of current GitHub labels and resolve unclear descriptions, then check issue guidance for the general triage → validation → human acceptance process. Skills should mention the `state:*` namespace without enumerating exact labels, and should not depend on `agent:*` labels. A direct request authorizes only the requested phase; unattended work uses current state descriptions, maintainer assignments, and comments to establish the authorized phase.
4343
4. Check issue templates, `create-github-issue`, `create-spike`, and `triage-issue` for the first-hand OpenShell User Story, OpenShell-only bug reproduction, notional UX examples, and consideration of applicable extension points.
44-
5. Check the PR template, `create-github-pr`, `build-from-issue`, `fix-security-issue`, and `CONTRIBUTING.md`: every PR must close an existing issue covering its scope, except automated dependency updates as described in `CONTRIBUTING.md`. Multi-PR work needs an issue per PR; a separate issue may track the overall effort.
44+
5. Check the PR template, `create-github-pr`, `build-from-issue`, `fix-security-issue`, and `CONTRIBUTING.md`: every PR must close an existing issue covering its scope, except automated dependency updates and build or flaky-test fixes from authors with write access, as described in `CONTRIBUTING.md`. Multi-PR work needs an issue per PR; a separate issue may track the overall effort.
4545
6. Check contributor branch instructions and examples against Branch Names in `CONTRIBUTING.md`; AGENTS.md and skills should refer to that convention. Check `README.md`, `.github/ISSUE_TEMPLATE/`, `.github/workflows/`, `.agents/agents/`, and related skill cross references for stale workflow statements. Keep user-facing documentation changes minimal and avoid duplicated internal explanations.
4646
7. Check that PR, build, TUI, and docs contribution guidance follow the scoped verification guidance in `CONTRIBUTING.md`; they must not require full Rust, SDK, or repository CI for changes that cannot affect those areas.
4747
8. Use `npx -y skills add . --list` from a disposable clean copy when skill discovery changes. It should expose public skills only; clean generated files afterward.

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- 1-3 sentences: what this PR does and why -->
33

44
## Related Issue
5-
<!-- Every PR must close an existing issue covering its scope, except automated dependency updates. Use Closes #NNN; see CONTRIBUTING.md for the exception. Authors without repository write access must link at least one issue with state:accepted. PR body text cannot bypass this acceptance check. -->
5+
<!-- Every PR must close an existing issue covering its scope, except automated dependency updates and build or flaky-test fixes from authors with write access. Use Closes #NNN; see CONTRIBUTING.md for the exceptions. Authors without repository write access must link at least one issue with state:accepted. PR body text cannot bypass this acceptance check. -->
66

77
## Changes
88
<!-- Bullet list of key changes -->

‎.github/actions/build-rust-binary/action.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ inputs:
3636
runs:
3737
using: composite
3838
steps:
39+
# Per-binary caches are large and other branches can restore main's, so
40+
# saving them elsewhere mostly evicts main's from the shared quota.
3941
- uses: ./.github/actions/setup-rust
4042
with:
4143
cache-key: binaries-v2-${{ inputs.binary }}-${{ inputs.triple }}
42-
save-cache: "true"
44+
save-cache: ${{ github.ref == 'refs/heads/main' }}
4345

4446
- name: Set version
4547
shell: nix develop -c bash -euo pipefail {0}

‎.github/actions/check-latest-release/action.yml‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
name: Check Latest Release
5-
description: Check current remote stable tags before updating a shared latest channel
5+
description: Check current remote release tags before updating a shared latest channel
66

77
inputs:
88
release-tag:
9-
description: Stable version being published
9+
description: Stable or prerelease version being published
1010
required: true
1111

1212
outputs:
1313
make-latest:
14-
description: Whether this is still the highest stable version in the repository
14+
description: Whether this is still the highest release version in the repository
1515
value: ${{ steps.latest.outputs.make-latest }}
1616

1717
runs:
@@ -24,23 +24,33 @@ runs:
2424
with:
2525
script: |
2626
const tag = process.env.RELEASE_TAG;
27-
const parse = value => /^v([0-9]+)\.([0-9]+)\.([0-9]+)$/.exec(value)?.slice(1).map(BigInt);
27+
const includePrereleases = tag.includes('-pre.');
28+
const parse = value => {
29+
const match = /^v([0-9]+)\.([0-9]+)\.([0-9]+)(?:-pre\.([1-9][0-9]*))?$/.exec(value);
30+
if (!match) return null;
31+
return [BigInt(match[1]), BigInt(match[2]), BigInt(match[3]), match[4] ? 0n : 1n, BigInt(match[4] || 0)];
32+
};
33+
const compare = (left, right) => {
34+
for (let i = 0; i < left.length; i++) {
35+
if (left[i] !== right[i]) return left[i] < right[i] ? -1 : 1;
36+
}
37+
return 0;
38+
};
2839
const version = parse(tag);
2940
if (!version) {
30-
throw new Error(`Invalid stable release tag: ${tag}`);
41+
throw new Error(`Invalid release tag: ${tag}`);
3142
}
3243
const tags = await github.paginate(github.rest.repos.listTags, {
3344
...context.repo,
3445
per_page: 100,
3546
});
3647
if (!tags.some(candidate => candidate.name === tag)) {
37-
throw new Error(`Stable release tag ${tag} is missing from the repository`);
48+
throw new Error(`Release tag ${tag} is missing from the repository`);
3849
}
3950
const newer = tags.find(candidate => {
51+
if (!includePrereleases && candidate.name.includes('-pre.')) return false;
4052
const other = parse(candidate.name);
41-
if (!other) return false;
42-
const index = other.findIndex((part, i) => part !== version[i]);
43-
return index !== -1 && other[index] > version[index];
53+
return other && compare(other, version) > 0;
4454
});
45-
core.info(newer ? `${tag} is superseded by ${newer.name}; preserving latest` : `${tag} is the latest stable version`);
55+
core.info(newer ? `${tag} is superseded by ${newer.name}; preserving latest` : `${tag} is the latest release version`);
4656
core.setOutput('make-latest', !newer);

‎.github/actions/setup-rust/action.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ inputs:
1313
required: false
1414
default: "false"
1515

16+
outputs:
17+
cache-hit:
18+
description: "true when the cache key matched exactly"
19+
value: ${{ steps.cache.outputs.cache-hit }}
20+
1621
runs:
1722
using: composite
1823
steps:
@@ -24,6 +29,7 @@ runs:
2429
echo "hash=$(nix hash file --type sha256 --base16 "$shell_drv")" >> "$GITHUB_OUTPUT"
2530
2631
- name: Cache Rust target and registry
32+
id: cache
2733
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
2834
with:
2935
shared-key: ${{ inputs.cache-key }}-${{ steps.dev-shell.outputs.hash }}

‎.github/workflows/release-prerelease.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ jobs:
6363
python-version: ${{ needs.build.outputs.python_version }}
6464
npm-version: ${{ needs.build.outputs.npm_version }}
6565
is-prerelease: true
66+
secrets:
67+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
6668

6769
qualify:
6870
name: Qualify

‎.github/workflows/release-publish.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ jobs:
517517
secrets:
518518
publish-credentials: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
519519

520+
publish-prerelease-snap:
521+
name: Publish Prerelease Snap
522+
needs: release
523+
if: inputs.is-prerelease
524+
uses: ./.github/workflows/snap-publish.yml
525+
with:
526+
upload-channel: latest/beta
527+
release-tag: ${{ inputs.release-tag }}
528+
github-environment: latest/beta
529+
secrets:
530+
publish-credentials: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
531+
520532
publish-sdk-typescript:
521533
name: Publish TypeScript SDK
522534
needs: release

‎.github/workflows/rust-cache.yml‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Rust Cache
5+
6+
# Branch Checks never runs on main, so this saves the rust-checks cache that PR
7+
# mirrors and merge groups restore. Keep env and build commands aligned with
8+
# the Branch Checks rust-test job so the cache keys and contents match.
9+
on:
10+
push:
11+
branches:
12+
- main
13+
workflow_dispatch:
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
CARGO_INCREMENTAL: "0"
18+
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
permissions:
21+
contents: read
22+
packages: read
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
# Let runs finish so frequent merges cannot keep cancelling the save.
27+
cancel-in-progress: false
28+
29+
jobs:
30+
rust-checks:
31+
name: Rust checks cache (${{ matrix.system }})
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- runner: linux-amd64-cpu8
37+
system: x86_64-linux
38+
- runner: linux-arm64-cpu8
39+
system: aarch64-linux
40+
- runner: macos-15-xlarge
41+
system: aarch64-darwin
42+
runs-on: ${{ matrix.runner }}
43+
timeout-minutes: 45
44+
steps:
45+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
46+
with:
47+
persist-credentials: false
48+
49+
- uses: ./.github/actions/setup-nix
50+
with:
51+
prepare-shell: "true"
52+
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
53+
54+
- id: rust
55+
uses: ./.github/actions/setup-rust
56+
with:
57+
cache-key: rust-checks-v2
58+
save-cache: "true"
59+
60+
- name: Build tests
61+
if: steps.rust.outputs.cache-hit != 'true'
62+
shell: nix develop -c bash -euo pipefail {0}
63+
run: |
64+
cargo test --locked -p openshell-crypto --no-default-features --test independent_backend --no-run
65+
cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support --no-run
66+
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --no-run
67+
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml --no-run

‎.github/workflows/snap-publish.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
runs-on: ${{ matrix.runner }}
4242
timeout-minutes: 10
4343
environment: ${{ inputs.github-environment }}
44+
concurrency:
45+
group: snap-publish-${{ inputs.upload-channel }}-${{ matrix.arch }}
46+
cancel-in-progress: false
47+
queue: max
4448
steps:
4549
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4650
if: inputs.release-tag != ''
@@ -90,6 +94,9 @@ jobs:
9094
snap_name="${snap_name%%_*}"
9195
component_args=()
9296
for comp in "${snap_name}"+*.comp; do
93-
component_args+=(--component "$comp")
97+
component_file="${comp##*/}"
98+
component_name="${component_file#${snap_name}+}"
99+
component_name="${component_name%%_*}"
100+
component_args+=(--component "${component_name}=${comp}")
94101
done
95102
snapcraft upload --release "${INPUTS_UPLOAD_CHANNEL}" "$snap_file" "${component_args[@]}"

0 commit comments

Comments
 (0)