Skip to content

Commit 839a12e

Browse files
committed
fix(security): refresh hardening against current main
Resolve current-main conflicts while preserving newer same-origin and loopback protections. Tighten remote memory identity handling, exact-origin upstream allowlisting, and DNS failure behavior.
2 parents 6cf575e + b88b907 commit 839a12e

431 files changed

Lines changed: 39213 additions & 3138 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.

.cargo/audit.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# cargo-audit configuration for the Rust workspace.
2+
#
3+
# Path matters: cargo-audit reads `.cargo/audit.toml`, not a root-level
4+
# `audit.toml`. A file at the repo root is silently ignored.
5+
#
6+
# The `audit` job in .github/workflows/rust.yml is a BLOCKING gate. It runs on
7+
# every PR touching Rust and nightly on the schedule (the `rust-changes` job
8+
# reports `rust=true` for `schedule`/`workflow_dispatch`, so a newly-disclosed
9+
# advisory surfaces without anyone touching Rust code).
10+
#
11+
# It was `continue-on-error: true` until the change that added this file, which meant it reported findings
12+
# nobody saw: RUSTSEC-2026-0258 (h2, unbounded empty DATA frames) sat in a green
13+
# run. Anything ignored here has to be listed explicitly, with a reason.
14+
15+
[advisories]
16+
ignore = [
17+
# `paste` is unmaintained — an advisory of project status, not a
18+
# vulnerability; there is no patched version to move to. It is transitive
19+
# and unavoidable at our layer: tokenizers -> paste and rav1e -> paste,
20+
# both reached via fastembed. Re-evaluate when tokenizers moves to
21+
# `pastey` (the maintained drop-in fork).
22+
"RUSTSEC-2024-0436",
23+
]

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
},
66
"metadata": {
77
"description": "Headroom marketplace for Claude Code and GitHub Copilot CLI plugins.",
8-
"version": "0.34.0"
8+
"version": "0.36.0"
99
},
1010
"plugins": [
1111
{
1212
"name": "headroom",
1313
"source": "./plugins/headroom-agent-hooks",
1414
"description": "Headroom startup hooks for Claude Code and GitHub Copilot CLI.",
15-
"version": "0.34.0",
15+
"version": "0.36.0",
1616
"author": {
1717
"name": "Headroom Contributors",
1818
"url": "https://github.com/chopratejas/headroom"

.commitlintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": ["@commitlint/config-conventional"],
33
"rules": {
4-
"body-max-line-length": [2, "always", 200],
4+
"body-max-line-length": [0],
55
"footer-leading-blank": [0],
66
"subject-case": [0],
77
"type-enum": [
@@ -12,6 +12,7 @@
1212
"chore",
1313
"ci",
1414
"docs",
15+
"deps",
1516
"feat",
1617
"fix",
1718
"parity",
@@ -23,4 +24,4 @@
2324
]
2425
]
2526
}
26-
}
27+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ Closes #
4040
- Observed result:
4141
- Not tested:
4242

43+
## Runtime Rollout Safety
44+
45+
- Rollout-managed feature(s):
46+
- Minimum rollout channel:
47+
- Stable/default behavior changed:
48+
- Kill switch / disable path:
49+
- Unsafe override required:
50+
- Qualification impact:
51+
- Rollback path:
52+
4353
## Review Readiness
4454

4555
- [ ] I have performed a self-review
Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
{
2-
"action": "ready_for_review",
3-
"number": 42,
4-
"pull_request": {
5-
"number": 42,
6-
"draft": false,
7-
"title": "feat: add PR governance",
8-
"body": "## Description\n\nAdd a required PR governance check and commit-msg enforcement.\n\nCloses #123\n\n## Type of Change\n\n- [x] New feature (non-breaking change that adds functionality)\n\n## Changes Made\n\n- Added workflow validation for PR template completeness.\n- Added a commit-msg hook that runs commitlint locally.\n\n## Testing\n\n- [x] Unit tests pass (`pytest`)\n- [x] Manual testing performed\n\n### Test Output\n\n```text\npytest scripts/tests/test_pr_governance.py -q\n```\n\n## Real Behavior Proof\n\n- Environment: Ubuntu runner, Python 3.12\n- Exact command / steps: Opened a PR with an incomplete template, then fixed the body.\n- Observed result: The governance check failed until the template and readiness boxes were complete.\n- Not tested: Repository-level automatic Copilot rulesets.\n\n## Review Readiness\n\n- [x] I have performed a self-review\n- [x] This PR is ready for human review\n",
9-
"user": {
10-
"login": "octocat"
11-
},
12-
"base": {
13-
"sha": "dff6a199"
14-
}
15-
},
16-
"repository": {
17-
"full_name": "JerrettDavis/headroom"
18-
}
19-
}
1+
{
2+
"action": "ready_for_review",
3+
"number": 42,
4+
"pull_request": {
5+
"number": 42,
6+
"draft": false,
7+
"title": "feat: add PR governance",
8+
"body": "## Description\n\nAdd a required PR governance check and commit-msg enforcement.\n\n## Type of Change\n\n- [x] New feature (non-breaking change that adds functionality)\n\n## Changes Made\n\n- Added workflow validation for PR template completeness.\n\n## Testing\n\n- [x] Unit tests pass (`pytest`)\n\n### Test Output\n\n```text\npytest scripts/tests/test_pr_governance.py -q\n```\n\n## Real Behavior Proof\n\n- Environment: Ubuntu runner, Python 3.12\n- Exact command / steps: Opened a PR and ran governance.\n- Observed result: The check passed with complete facts.\n- Not tested: Repository settings.\n\n## Runtime Rollout Safety\n\n- Rollout-managed feature(s): None.\n- Minimum rollout channel: Stable.\n- Stable/default behavior changed: No.\n- Kill switch / disable path: Not applicable.\n- Unsafe override required: No.\n- Qualification impact: None.\n- Rollback path: Revert the workflow and script changes.\n\n## Review Readiness\n\n- [x] I have performed a self-review\n- [x] This PR is ready for human review\n",
9+
"user": {"login": "octocat"},
10+
"base": {"sha": "dff6a199"}
11+
},
12+
"repository": {"full_name": "JerrettDavis/headroom"}
13+
}

.github/plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
},
66
"metadata": {
77
"description": "Headroom marketplace for Claude Code and GitHub Copilot CLI plugins.",
8-
"version": "0.34.0"
8+
"version": "0.36.0"
99
},
1010
"plugins": [
1111
{
1212
"name": "headroom",
1313
"source": "./plugins/headroom-agent-hooks",
1414
"description": "Headroom startup hooks for Claude Code and GitHub Copilot CLI.",
15-
"version": "0.34.0",
15+
"version": "0.36.0",
1616
"author": {
1717
"name": "Headroom Contributors",
1818
"url": "https://github.com/chopratejas/headroom"
180 KB
Loading

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ jobs:
561561
- name: Install test dependencies
562562
run: |
563563
python -m pip install --upgrade pip
564-
pip install pytest
564+
pip install pytest 'opentelemetry-api>=1.24.0'
565565
- name: Run native installer wrapper tests
566566
run: pytest tests/test_install/test_native_installers.py -q
567567

@@ -579,7 +579,7 @@ jobs:
579579
run: |
580580
brew install bash
581581
python -m pip install --upgrade pip
582-
python -m pip install --retries 10 --timeout 60 pytest
582+
python -m pip install --retries 10 --timeout 60 pytest 'opentelemetry-api>=1.24.0'
583583
- name: Run native installer wrapper tests
584584
run: |
585585
BASH_PREFIX="$(brew --prefix bash)"

.github/workflows/docker.yml

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ jobs:
204204
- name: Upload digest marker
205205
uses: actions/upload-artifact@v7
206206
with:
207-
# Variant + arch in the artifact name so the manifest job can
208-
# download with `pattern: digests-<variant>-*` to gather all
209-
# arches for one variant. `root` substitutes the empty-string
210-
# variant since GHA artifact names can't end in a hyphen.
207+
# Variant + arch uniquely identify the marker. The manifest job
208+
# downloads both architecture artifacts by exact name; a glob such
209+
# as `digests-code-*` would also match code-nonroot/code-slim.
210+
# `root` substitutes the empty-string variant.
211211
name: digests-${{ matrix.variant.name || 'root' }}-${{ matrix.arch.name }}
212212
path: ${{ runner.temp }}/digests/*
213213
if-no-files-found: error
@@ -220,6 +220,7 @@ jobs:
220220
# tags, and that manifest is what users pull by `:tag`.
221221
docker-manifest:
222222
needs: docker-build
223+
if: ${{ always() }}
223224
runs-on: ubuntu-24.04
224225
timeout-minutes: 20
225226
strategy:
@@ -272,12 +273,17 @@ jobs:
272273
username: ${{ github.actor }}
273274
password: ${{ secrets.GITHUB_TOKEN }}
274275

275-
- name: Download per-arch digests for this variant
276+
- name: Download amd64 digest for this variant
276277
uses: actions/download-artifact@v8
277278
with:
278-
pattern: digests-${{ matrix.variant.name || 'root' }}-*
279+
name: digests-${{ matrix.variant.name || 'root' }}-amd64
280+
path: ${{ runner.temp }}/digests
281+
282+
- name: Download arm64 digest for this variant
283+
uses: actions/download-artifact@v8
284+
with:
285+
name: digests-${{ matrix.variant.name || 'root' }}-arm64
279286
path: ${{ runner.temp }}/digests
280-
merge-multiple: true
281287

282288
# Same tag rules as the pre-fan-out workflow — preserve every
283289
# tag flavor (semver, ref, sha-prefixed, version-suffixed,
@@ -313,6 +319,11 @@ jobs:
313319
echo "ERROR: no digests downloaded for variant '${{ matrix.variant.name || 'root' }}'" >&2
314320
exit 1
315321
fi
322+
digest_count="$(find "${DIGEST_DIR}" -maxdepth 1 -type f | wc -l)"
323+
if [ "${digest_count}" -ne 2 ]; then
324+
echo "ERROR: expected both architecture digests for variant '${{ matrix.variant.name || 'root' }}', found ${digest_count}" >&2
325+
exit 1
326+
fi
316327
digest_refs=()
317328
for f in "${DIGEST_DIR}"/*; do
318329
digest="$(basename "$f")"
@@ -382,53 +393,13 @@ jobs:
382393
sleep "$sleep_for"
383394
done
384395
385-
promote-latest:
386-
# Re-push the :latest tag pointing at the root variant *after* every
387-
# variant manifest job has finished, so GHCR's package version
388-
# listing (sorted by created_at) shows the root image with :latest
389-
# at the top instead of whichever variant happened to finish last.
390-
needs: docker-manifest
391-
runs-on: ubuntu-24.04
392-
timeout-minutes: 10
393-
steps:
394-
- name: Normalize image name
395-
id: image-name
396-
run: |
397-
image_name="$(printf '%s' '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')"
398-
printf 'image_name=%s\n' "$image_name" >> "$GITHUB_OUTPUT"
399-
400-
- name: Determine image version
401-
id: version
402-
env:
403-
MANUAL_VERSION: ${{ inputs.version || github.event.inputs.version }}
404-
RELEASE_TAG: ${{ github.event.release.tag_name }}
405-
run: |
406-
version="${MANUAL_VERSION#v}"
407-
if [ -z "$version" ] && [ -n "$RELEASE_TAG" ]; then
408-
version="${RELEASE_TAG#v}"
409-
fi
410-
printf 'version=%s\n' "$version" >> "$GITHUB_OUTPUT"
411-
412-
- name: Set up Docker Buildx
413-
uses: docker/setup-buildx-action@v4
414-
415-
- name: Log in to GHCR
416-
uses: docker/login-action@v4
417-
with:
418-
registry: ${{ env.REGISTRY }}
419-
username: ${{ github.actor }}
420-
password: ${{ secrets.GITHUB_TOKEN }}
421-
422396
- name: Re-tag root image as :latest
423-
if: steps.version.outputs.version != ''
397+
if: steps.manifest.outputs.index_digest != '' && matrix.variant.name == '' && steps.version.outputs.version != ''
424398
env:
425399
IMAGE: ${{ env.REGISTRY }}/${{ steps.image-name.outputs.image_name }}
426400
VERSION: ${{ steps.version.outputs.version }}
427401
run: |
428-
# Add a unique annotation so the resulting image index manifest gets
429-
# a new digest, which makes GHCR record a fresh package version with
430-
# current timestamp (otherwise the existing root manifest is reused
431-
# and stays where it was in the version listing).
402+
# Add a unique annotation so GHCR records a fresh root package version.
432403
promoted_at="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
433404
docker buildx imagetools create \
434405
--annotation "index:io.headroom.promoted-at=${promoted_at}" \

.github/workflows/opencode-plugin.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ on:
1111
paths:
1212
- "plugins/opencode/**"
1313
- "headroom/providers/opencode/_dist/**"
14+
- "headroom/providers/opencode/hook-shim/**"
1415
- ".github/workflows/opencode-plugin.yml"
1516
push:
1617
branches: [main]
1718
paths:
1819
- "plugins/opencode/**"
1920
- "headroom/providers/opencode/_dist/**"
21+
- "headroom/providers/opencode/hook-shim/**"
2022
- ".github/workflows/opencode-plugin.yml"
2123

2224
permissions:
@@ -51,3 +53,6 @@ jobs:
5153
cmp dist-standalone/entry.opencode.js \
5254
../../headroom/providers/opencode/_dist/entry.opencode.js \
5355
|| { echo "::error::headroom/providers/opencode/_dist/entry.opencode.js is stale - run 'npm run build:standalone' in plugins/opencode and commit the result"; exit 1; }
56+
cmp dist-standalone/hook-shim/handler.js \
57+
../../headroom/providers/opencode/hook-shim/handler.js \
58+
|| { echo "::error::headroom/providers/opencode/hook-shim/handler.js is stale - run 'npm run build:standalone' in plugins/opencode and commit the result"; exit 1; }

0 commit comments

Comments
 (0)