Skip to content

Commit b1ec315

Browse files
committed
chore: copy reapply carry-over files from feat/rust-v0.144.6
1 parent 25af12f commit b1ec315

50 files changed

Lines changed: 3038 additions & 7338 deletions

Some content is hidden

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

.agents/skills/codex-upstream-reapply/SKILL.md

Lines changed: 265 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Advanced Recipes
2+
3+
## Two worktrees for side-by-side porting (recommended)
4+
5+
Use when:
6+
- You want to read old code/docs while implementing on the new tag-based branch.
7+
- You want to avoid constantly switching branches.
8+
9+
Example:
10+
11+
```bash
12+
# In repo root (adjust paths as needed)
13+
git fetch upstream 'refs/tags/rust-*:refs/tags/rust-*' --prune
14+
15+
# Old branch worktree (reference)
16+
git worktree add /tmp/wt-old OLD_BRANCH
17+
18+
# New branch worktree (fresh branch from selected tag)
19+
git worktree add -b NEW_BRANCH /tmp/wt-new TAG
20+
```
21+
22+
Cleanup:
23+
24+
```bash
25+
git worktree remove /tmp/wt-old
26+
git worktree remove /tmp/wt-new
27+
```
28+
29+
## Find the real delta of OLD_BRANCH (merge-base vs tag)
30+
31+
Use when:
32+
- Your old branch was based on an older tag/commit and you want the exact “custom delta”.
33+
34+
Example:
35+
36+
```bash
37+
BASE_COMMIT="$(git merge-base TAG OLD_BRANCH)"
38+
git diff "${BASE_COMMIT}..OLD_BRANCH" > /tmp/old-delta.patch
39+
git diff --name-status "${BASE_COMMIT}..OLD_BRANCH"
40+
```
41+
42+
## Read old files without switching branches
43+
44+
Use when:
45+
- You are on NEW_BRANCH but want to view old docs/code quickly.
46+
47+
```bash
48+
git show OLD_BRANCH:path/to/file
49+
```
50+
51+
For diffs:
52+
53+
```bash
54+
git diff OLD_BRANCH -- path/to/file
55+
```
56+
57+
## Compare “custom delta” old vs new
58+
59+
Use when:
60+
- NEW_BRANCH is based on a selected tag and you want to verify your re-implementation covers the old intent.
61+
62+
```bash
63+
OLD_BASE="$(git merge-base TAG OLD_BRANCH)"
64+
65+
# Old delta (against its original base)
66+
git diff "${OLD_BASE}..OLD_BRANCH" > /tmp/old.patch
67+
68+
# New delta (against selected tag)
69+
git diff TAG..NEW_BRANCH > /tmp/new.patch
70+
71+
# Optional quick check (names only)
72+
git diff --name-status "${OLD_BASE}..OLD_BRANCH"
73+
git diff --name-status TAG..NEW_BRANCH
74+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# NPM Release Reapply Rules
2+
3+
## Package identity
4+
5+
- npm package: `@loongphy/codext`
6+
- Platform packages: `@loongphy/codext-{linux-x64,linux-arm64,darwin-x64,darwin-arm64,win32-x64}`
7+
- User command: `codext` (not `codex`)
8+
- Native binary inside vendor: `codex` / `codex.exe` (unchanged)
9+
- All user-facing text (tooltips, resume hints, README) must say `codext`
10+
11+
## Mandatory copy from OLD_BRANCH
12+
13+
Use the OLD_BRANCH release workflow as the `F_OLD` packaging baseline, then apply the release CI sync procedure before pushing. Copy these codext packaging files from OLD_BRANCH:
14+
15+
1. `.github/workflows/rust-release.yml`
16+
2. `.github/scripts/install-musl-build-tools.sh`
17+
3. `.github/scripts/rusty_v8_bazel.py`
18+
4. `codex-cli/package.json`
19+
5. `codex-cli/bin/codex.js`
20+
6. `codex-cli/bin/rg`
21+
7. `codex-cli/scripts/build_npm_package.py`
22+
8. `codex-cli/scripts/install_native_deps.py`
23+
24+
## Mandatory deletes
25+
26+
Delete all `.github/workflows/*` that OLD_BRANCH deleted (i.e. workflows carried over from the upstream tag but not needed by this fork). Do not blindly delete workflows that upstream TAG newly added — evaluate those after the mandatory steps.
27+
28+
## Verify release workflow compatibility
29+
30+
Read [release-ci-sync.md](release-ci-sync.md) together with the npm release work, immediately before the final commit and push. It defines the three-way `U_OLD` / `F_OLD` / `U_NEW` comparison, the build/GitHub Release/npm Release scope, model-driven application of upstream changes, and the required final report.
31+
32+
## After mandatory steps
33+
34+
Only then evaluate upstream TAG's new/changed CI files. If they don't affect the release pipeline, ignore them. If they must be merged, do minimal integration without changing package names or command names.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Release CI Sync
2+
3+
Run this procedure together with the npm/release work, after implementation is complete and immediately before the final commit and push. This is a release workflow review, not a GitHub Actions monitoring loop.
4+
5+
## Scope
6+
7+
Only carry upstream release workflow changes that affect:
8+
9+
1. Build and shipped artifacts.
10+
2. GitHub Release assets.
11+
3. npm package staging or publication.
12+
13+
Use the artifact flow to decide scope:
14+
15+
```text
16+
build -> upload/download -> archive/vendor -> GitHub Release or npm publish
17+
```
18+
19+
Include setup, signing, checksum, and verification changes when they affect that flow. Exclude unrelated upstream products and jobs, such as website deployment or an independent wheel, unless the current codext release consumes their output.
20+
21+
## Three-way inputs
22+
23+
Use the explicit old base tag. Do not infer it from branch names:
24+
25+
```text
26+
U_OLD = OLD_BASE_TAG:.github/workflows/rust-release.yml
27+
F_OLD = OLD_BRANCH:.github/workflows/rust-release.yml
28+
U_NEW = NEW_TAG:.github/workflows/rust-release.yml
29+
```
30+
31+
Read `git diff U_OLD..U_NEW` to discover upstream's final release changes. Treat `F_OLD` as the working release baseline because it contains the known-good codext packaging flow. Do not replace it with `U_NEW` wholesale.
32+
33+
## Model decision
34+
35+
The model decides which upstream changes to apply. Inventory and `git diff` are evidence, not an automatic patch authority.
36+
37+
For every upstream release change, classify it as:
38+
39+
- `APPLIED`: patch or re-implement it in the existing codext build, GitHub Release, or npm Release flow.
40+
- `OVERRIDE`: retain the codext behavior because it is an intentional long-term fork policy.
41+
- `NOT_APPLIED`: leave it out when it is outside the three release scopes.
42+
43+
When the workflow structures differ, re-implement the upstream behavior in the existing codext structure. Do not force a textual patch or replace the whole workflow.
44+
45+
Do not hardcode a particular upstream binary in this procedure. Discover binaries from the upstream release matrix and trace each one through the artifact flow. Companion binaries required by an existing codext executable are in scope; independent upstream products are not automatically added.
46+
47+
Changes that cannot be proved relevant to the three scopes are not applied. Report them in the final response with the upstream change, its purpose, and why it was not applied.
48+
49+
## Fork overrides
50+
51+
Read `release-overrides.json` before making the decision. It contains only long-lived codext policy, such as package identity, command name, and intentionally different release triggers.
52+
53+
The model may update the manifest automatically when a difference is clearly a durable fork policy. Include that update in the same commit as the release workflow changes. Explain every manifest change in the final response. Do not add one-off tag-specific observations to the manifest.
54+
55+
## Required checks
56+
57+
Before committing and pushing npm/release work:
58+
59+
1. Run `bash .agents/skills/codex-upstream-reapply/scripts/check_release_artifact_parity.sh` as a generic structural preflight.
60+
2. Compare the upstream binary matrix with the current build commands and follow every in-scope output through upload, archive/vendor, and publish steps.
61+
3. Use the upstream workspace-level Cargo invocation for the selected binary set; do not split companion binaries into separate package builds.
62+
4. Run the skill's local build acceptance. Do not run tests, snapshots, formatters, or linters under the reapply guardrails.
63+
5. Include `APPLIED`, `OVERRIDE`, and `NOT_APPLIED` decisions in the final report.
64+
65+
GitHub Actions is a separate follow-up workflow. Do not wait for or repeatedly repair Actions unless the user explicitly asks to read or fix CI.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"workflow": ".github/workflows/rust-release.yml",
3+
"scope": [
4+
"build-artifacts",
5+
"github-release",
6+
"npm-release"
7+
],
8+
"identity": {
9+
"npm_package": "@loongphy/codext",
10+
"platform_package_prefix": "@loongphy/codext-",
11+
"cli_command": "codext"
12+
},
13+
"trigger": {
14+
"mode": "main_push",
15+
"reason": "codext publishes continuous fork builds instead of upstream tag releases"
16+
},
17+
"allowed_deviations": []
18+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
repo_root="$(git rev-parse --show-toplevel)"
5+
workflow="${repo_root}/.github/workflows/rust-release.yml"
6+
7+
if [[ ! -f "${workflow}" || ! -f "${repo_root}/codex-cli/package.json" ]]; then
8+
exit 0
9+
fi
10+
11+
required_patterns=(
12+
"cargo build"
13+
"actions/upload-artifact"
14+
"npm publish"
15+
)
16+
for pattern in "${required_patterns[@]}"; do
17+
if ! rg -F --quiet -- "${pattern}" "${workflow}"; then
18+
echo "[ERROR] Release workflow is missing required release surface: ${pattern}" >&2
19+
exit 1
20+
fi
21+
done
22+
23+
for path in \
24+
"${repo_root}/codex-cli/scripts/build_npm_package.py" \
25+
"${repo_root}/codex-cli/scripts/install_native_deps.py" \
26+
"${repo_root}/scripts/install/install.sh" \
27+
"${repo_root}/scripts/install/install.ps1" \
28+
"${repo_root}/scripts/codex_package/cargo.py"; do
29+
if [[ ! -f "${path}" ]]; then
30+
echo "[ERROR] Release packaging path is missing: ${path}" >&2
31+
exit 1
32+
fi
33+
done
34+
35+
echo "[OK] Release CI structural preflight passed; complete semantic review from release-ci-sync.md"

0 commit comments

Comments
 (0)