Skip to content

Commit 2e14b80

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-issue1620-1621-1653-1657-1658
# Conflicts: # tests/CodeIndex.Tests/IndexCommandRunnerTests.cs
2 parents ef0a95d + 8335677 commit 2e14b80

58 files changed

Lines changed: 1792 additions & 281 deletions

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release-critical paths require review from the repository owner.
2+
/.github/workflows/ @Widthdom
3+
/install.sh @Widthdom
4+
/src/CodeIndex/CodeIndex.csproj @Widthdom
5+
/nuget.config @Widthdom

.github/workflows/release.yml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ on:
1818

1919
permissions:
2020
contents: write
21+
id-token: write
22+
attestations: write
2123

2224
jobs:
2325
release:
@@ -388,6 +390,52 @@ jobs:
388390
cd release-files
389391
sha256sum * > sha256sums.txt
390392
393+
- name: Import release GPG key
394+
env:
395+
RELEASE_GPG_PRIVATE_KEY: ${{ secrets.RELEASE_GPG_PRIVATE_KEY }}
396+
RELEASE_GPG_PASSPHRASE: ${{ secrets.RELEASE_GPG_PASSPHRASE }}
397+
run: |
398+
set -euo pipefail
399+
if [ -z "${RELEASE_GPG_PRIVATE_KEY}" ]; then
400+
echo "RELEASE_GPG_PRIVATE_KEY secret is required to sign sha256sums.txt." >&2
401+
exit 1
402+
fi
403+
404+
mkdir -p ~/.gnupg
405+
chmod 700 ~/.gnupg
406+
printf '%s' "${RELEASE_GPG_PRIVATE_KEY}" | gpg --batch --import
407+
if [ -n "${RELEASE_GPG_PASSPHRASE}" ]; then
408+
printf '%s' "${RELEASE_GPG_PASSPHRASE}" > ~/.gnupg/release-passphrase
409+
chmod 600 ~/.gnupg/release-passphrase
410+
fi
411+
412+
- name: Sign release checksum manifest
413+
env:
414+
RELEASE_GPG_KEY_ID: ${{ secrets.RELEASE_GPG_KEY_ID }}
415+
RELEASE_GPG_PASSPHRASE: ${{ secrets.RELEASE_GPG_PASSPHRASE }}
416+
run: |
417+
set -euo pipefail
418+
sign_args=(--batch --yes --armor --detach-sign)
419+
if [ -n "${RELEASE_GPG_KEY_ID}" ]; then
420+
sign_args+=(--local-user "${RELEASE_GPG_KEY_ID}")
421+
fi
422+
if [ -n "${RELEASE_GPG_PASSPHRASE}" ]; then
423+
sign_args+=(--pinentry-mode loopback --passphrase-file ~/.gnupg/release-passphrase)
424+
fi
425+
426+
gpg "${sign_args[@]}" --output release-files/sha256sums.txt.asc release-files/sha256sums.txt
427+
test -s release-files/sha256sums.txt.asc
428+
429+
- name: Attest release artifacts
430+
uses: actions/attest-build-provenance@v2
431+
with:
432+
subject-path: |
433+
release-files/*.tar.gz
434+
release-files/*.zip
435+
release-files/*.cdx.json
436+
release-files/sha256sums.txt
437+
release-files/sha256sums.txt.asc
438+
391439
- name: Write release install notes
392440
run: |
393441
cat > release-install-notes.md <<'EOF'
@@ -472,7 +520,7 @@ jobs:
472520
# リリースが "Failed to download sha256sums.txt ... HTTP 404" で
473521
# 失敗した。verify step が取得する全 asset をポーリングし、伝播の
474522
# 遅い asset があってもリリースを失敗させず待ち切る。
475-
VERIFY_ASSET_NAMES: CodeIndex-linux-x64.tar.gz sha256sums.txt
523+
VERIFY_ASSET_NAMES: CodeIndex-linux-x64.tar.gz sha256sums.txt sha256sums.txt.asc
476524
run: |
477525
set -euo pipefail
478526
mapfile -t expected_assets < <(cd release-files && printf '%s\n' *)

AGENT_GUIDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ CI watching must be bounded. Do not loop indefinitely.
131131

132132
## Status Contract
133133

134-
- `status --json` and related JSON/MCP payloads currently expose the trust fields documented in `README.md` and `DEVELOPER_GUIDE.md`, including `fold_ready`, `fold_ready_reason`, `graph_table_available`, `issues_table_available`, `sql_graph_contract_ready`, `sql_graph_contract_degraded_reason`, `hotspot_family_ready`, `hotspot_family_degraded_reason`, `csharp_symbol_name_ready`, `csharp_metadata_target_ready`, `csharp_metadata_target_degraded_reason`, `indexed_head_commit`, `worktree_head_changed`, `index_writer_version`, `index_newer_than_reader`, `index_newer_than_reader_reason`, `unknown_extension_file_count`, `path_case_sensitive`, `data_dir`, `data_dir_source`, `data_dir_mode`, `mac_profile`, `db_pragma_settings` (`journal_mode`, `synchronous`, `wal_autocheckpoint`, `page_count`, `freelist_count`, `page_size`), `hooks`, MCP-only `mcp_session`, and the `status --check`-only `stale_after_seconds` / `index_age_seconds` threshold audit fields.
135-
- When `fold_ready` or `csharp_metadata_target_ready` is the only degraded readiness bit, the CLI also adds `degraded_reason`, `recommended_action`, and `alternative_action`.
134+
- `status --json` and related JSON/MCP payloads currently expose the trust fields documented in `README.md` and `DEVELOPER_GUIDE.md`, including `fold_ready`, `fold_ready_reason`, `graph_table_available`, `issues_table_available`, `file_issues_data_current`, `migration_in_progress`, `sql_graph_contract_ready`, `sql_graph_contract_degraded_reason`, `hotspot_family_ready`, `hotspot_family_degraded_reason`, `csharp_symbol_name_ready`, `csharp_metadata_target_ready`, `csharp_metadata_target_degraded_reason`, `indexed_head_commit`, `worktree_head_changed`, `index_writer_version`, `index_newer_than_reader`, `index_newer_than_reader_reason`, `unknown_extension_file_count`, `path_case_sensitive`, `data_dir`, `data_dir_source`, `data_dir_mode`, `mac_profile`, `db_pragma_settings` (`journal_mode`, `synchronous`, `wal_autocheckpoint`, `page_count`, `freelist_count`, `page_size`), `hooks`, MCP-only `mcp_session`, and the `status --check`-only `stale_after_seconds` / `index_age_seconds` threshold audit fields.
135+
- When any readiness field is degraded, the CLI adds `degraded_root_cause`, `degraded_reason`, `recommended_action`, `alternative_action`, and `readiness_degradations[]`. `degraded_root_cause` is the primary stable machine code; `readiness_degradations[]` lists every degraded field with `root_cause`, human reason, and remediation strings.
136+
- `issues_table_available` reports physical `file_issues` table presence only. `file_issues_data_current` reports whether the table is also stamped current for the active index generation.
136137
- `index_writer_version` records the `cdidx` version that last wrote to the DB (stamped into `codeindex_meta` as `cdidx_writer_version` on every full scan, update, and MCP index). `index_newer_than_reader` flips to `true` whenever any persisted numeric contract stamp in `codeindex_meta` (or unknown `PRAGMA user_version` readiness bits) exceeds the current binary's compiled maximum, so an older CLI re-opening a DB written by a newer CLI degrades loudly with an audit trail instead of silently dropping back to text-search fallbacks. `index_newer_than_reader_reason` enumerates the specific newer-than-reader stamps.
137138
- `status` also surfaces indexed-HEAD freshness via `indexed_head_sha`, `indexed_head_branch`, `indexed_head_timestamp`, and `commits_ahead_of_indexed_head`. They are stamped by `cdidx index` on every successful run (full scan AND partial update, distinct from `indexed_head_commit` which is full-scan only) on a best-effort basis (never blocks an otherwise-successful index) and omitted on non-git workspaces, detached HEAD (branch only), or legacy DBs created before this contract.
138139
- `status` also surfaces unknown-extension scan coverage via `unknown_extension_file_count`, stamped by successful full-repository index runs (`cdidx index <projectPath>` and MCP `index_project`) as the number of non-indexed files with non-empty extensions that do not map to a known language. It is omitted on legacy DBs or before a current full scan has stamped the value.

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ Keep changes focused and follow the existing style of the files you touch:
6262
contracts change;
6363
- add or update tests when behavior changes.
6464

65+
## Release-Critical Paths
66+
67+
Changes to release-critical files require CODEOWNERS review once branch
68+
protection is configured to require it:
69+
70+
- `.github/workflows/`
71+
- `install.sh`
72+
- `src/CodeIndex/CodeIndex.csproj`
73+
- `nuget.config`
74+
75+
When adding a new file that can affect release artifact contents, signing,
76+
publishing, installer behavior, or package restore trust, add it to
77+
`.github/CODEOWNERS` in the same change.
78+
6579
Before opening a pull request, run the checks that match the change. For code
6680
changes, the default full validation is:
6781

0 commit comments

Comments
 (0)