From 84590a2f09a483a349a14b8d9667abe66302aecc Mon Sep 17 00:00:00 2001 From: BeamoINT Date: Sat, 3 Oct 2026 14:57:00 -0500 Subject: [PATCH 1/3] chore: consolidate pending project updates and agent guidance --- .ai/memory/MEMORY.md | 4 +- .ai/memory/ci-audit-2026-09-26.md | 96 +++++++++++++++++++++ .github/workflows/dependency-review.yml | 5 ++ .github/workflows/labeler.yml | 7 +- .github/workflows/test.yml | 15 ++-- AGENTS.md | 107 ++++++++++++------------ CHANGELOG.md | 15 +++- CONTRIBUTING.md | 2 +- docs/development.md | 11 ++- package-lock.json | 4 +- package.json | 2 +- test.ps1 | 14 +++- test.zsh | 9 +- tests/legacy-linux-node.sh | 9 +- tests/self-update-lock-regressions.ps1 | 39 ++++++--- 15 files changed, 254 insertions(+), 85 deletions(-) create mode 100644 .ai/memory/ci-audit-2026-09-26.md diff --git a/.ai/memory/MEMORY.md b/.ai/memory/MEMORY.md index 12ed7c4..c97f65e 100644 --- a/.ai/memory/MEMORY.md +++ b/.ai/memory/MEMORY.md @@ -1,7 +1,7 @@ # Memory index -No durable project memories yet. Add dated notes as Markdown files in this directory and link them -from this index. +- [CI audit, 2026-09-26](ci-audit-2026-09-26.md): runner cost, workflow scope, + local checks, and the hosted verification still required. Memories are observations from a moment in time. Verify claims that may have drifted against current code. diff --git a/.ai/memory/ci-audit-2026-09-26.md b/.ai/memory/ci-audit-2026-09-26.md new file mode 100644 index 0000000..ca5aeac --- /dev/null +++ b/.ai/memory/ci-audit-2026-09-26.md @@ -0,0 +1,96 @@ +# CI audit, 2026-09-26 + +Scope: Claudex at `a8d4d21` with local, uncommitted CI edits. This is dated +evidence, not proof that the edits passed hosted CI. + +## Evidence and decisions + +- Audited all six GitHub Actions workflows, the required branch statuses, + native platform coverage, release checks, and local test entry points. +- The repository was public when checked. [GitHub billing guidance](https://docs.github.com/en/actions/concepts/billing-and-usage) + says standard hosted runners are free for public repositories. The standard + GitHub runner choice and Blacksmith exception are recorded in + `docs/development.md`. +- The [2026-09-23 Blacksmith run](https://github.com/BeamoTech/Claudex/actions/runs/35803572683) + waited nearly three hours for macOS. The + [2026-09-26 GitHub run](https://github.com/BeamoTech/Claudex/actions/runs/36283161738) + started macOS within seconds and completed the matrix in about 16 minutes. + Those are dated observations, not a guarantee of future queue times. +- On that GitHub run, the macOS Bash suite took 15 minutes 29 seconds; checkout + took two seconds and the following PowerShell test took 30 seconds. The Bash + suite is the wall time bottleneck. +- The [2026-07-22 release run](https://github.com/BeamoTech/Claudex/actions/runs/29904821169) + spent about 15 minutes in its macOS release gate, then 24 seconds in the + publishing job. The matching [installer verification](https://github.com/BeamoTech/Claudex/actions/runs/29905853826) + resolved the expected version in four seconds. These short jobs do not + justify changing release ordering or public installation coverage. +- Among the latest 100 Actions runs checked on 2026-09-26, three older pull + request test matrices were canceled during rapid source updates in August. + The existing main test concurrency is doing useful work; keep it. +- The latest inspected [CodeQL job](https://github.com/BeamoTech/Claudex/actions/runs/36283161748) + took 66 seconds. The inspected [dependency review](https://github.com/BeamoTech/Claudex/actions/runs/35924267214) + took four seconds and [labeler](https://github.com/BeamoTech/Claudex/actions/runs/35924267290) + took eight seconds. Their security and labeling coverage is worth retaining. +- `package-lock.json` lists only the root package and no external npm packages. + There is no dependency installation in the test matrix to accelerate with an + npm cache. The release builder uses repository files and local staging, so + an archive cache would risk stale source and cost more coordination. +- Local edits cancel superseded dependency review and labeler runs, remove a + redundant labeler event, and avoid a second apt index fetch in the legacy + Ubuntu test. +- [GitHub reusable workflow guidance](https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations) + says a called workflow inherits the caller's `github` context. The test + workflow now defaults a reusable call input to preserving an independent + run group, including when the optional `ref` is omitted. Direct branch and + pull request runs still cancel stale checks. The old + `github.event_name == 'workflow_call'` condition could not identify a call. +- Required statuses, native macOS, Ubuntu, and Windows suites, CodeQL, + dependency review, minimum Node coverage, and release gates remain present. +- Branch protection still requires `macos-15`, `ubuntu-24.04`, `windows-2025`, + `ubuntu-20.04-managed-node`, `package-artifacts`, `CodeQL`, and + `Dependency review` with strict up to date checking. The repository was + confirmed public again during this local review. + +## Local verification + +- The original `test.zsh` passed on macOS in 554 seconds against the edited + source. A trial that skipped some skill discovery passed twice in 565 and + 626 seconds, so it was removed: these runs did not show a speed benefit. +- A temporary profile of the passing suite measured about 153 seconds in proxy + and model checks, 111 seconds in composite launch checks, and 166 seconds in + update lock and detached update checks. These retain race and provider + boundary coverage. +- A later timing profile exposed a test race: the background status refresh + helper had only two seconds to publish its log before the Unix test read it. + The Unix and Windows suites now wait up to 20 seconds for four complete + lines, exiting early on the normal path. A deliberately delayed Unix helper + and the PowerShell fixture write passed locally. The exact edited `test.zsh` + suite passed in 676 seconds after the final fixture edits; native Windows + verification is still pending. +- Every preceding component of `test.sh` passed separately, including watcher, + authentication lock, Windows source parity, and test driver regressions. +- `npm test`, macOS PowerShell self update lock regressions, `actionlint`, Bash + syntax checks, Markdown checks, `git diff --check`, and release archive + reproducibility and extracted install checks passed. +- The agent, development, and contributor syntax commands now use + `bash -n test.zsh`, matching the script shebang and the shell that CI runs. +- The first authorized PR matrix on 2026-09-26 passed macOS, Ubuntu, Node 18, + archives, CodeQL, and dependency review. The Windows main suite also passed, + but its separate self update lock regression failed after an X/Y/Z race: + the next successful probe used a 12-attempt test limit, shorter than the + updater's two second stale lock grace. The test now requires Y to exit + successfully, gives that probe the normal 100-attempt budget, allows bounded + child completion on loaded hosts, and terminates remaining children before + fixture cleanup. Its focused macOS PowerShell run passed; the revised Windows + run still needs native verification. +- The first hosted Ubuntu 20.04 container job passed. The revised Windows test + and all required statuses on the final source still need hosted verification. + Before the user authorized that run, no hosted CI had been triggered. +- Parallelizing the short, isolated shell regressions in `test.sh` would save + little compared with the macOS launcher suite and would complicate its + early failure test driver. Keep their sequential order until measured evidence + justifies a change. + +Next action: verify the exact edited source on all required hosted platforms and +compare job times and required statuses with the dated baseline. Recheck +visibility and runner access before any provider change. diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index ee7c6ff..b9e5f31 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -7,6 +7,11 @@ on: permissions: contents: read +# A newer revision of the same PR supersedes an unfinished dependency review. +concurrency: + group: dependency-review-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: review: name: Dependency review diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 7642d63..88d9036 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -2,12 +2,17 @@ name: Pull request labeling on: pull_request_target: - types: [opened, synchronize, reopened, ready_for_review] + types: [opened, synchronize, reopened] permissions: contents: read pull-requests: write +# Labels are synchronized from the latest PR diff, so discard older updates. +concurrency: + group: labeler-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: label: name: Label changed areas diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 385ee8d..e1c5f1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,15 +11,20 @@ on: description: Git ref to test (defaults to the triggering ref) required: false type: string + preserve_run: + description: Keep each reusable verification gate independent + required: false + default: true + type: boolean permissions: contents: read -# A newer commit supersedes an in-flight run for the same ref. Reusable -# workflow calls get a per-run group so callers remain independent. +# A newer commit supersedes an in-flight direct run for the same ref. Reusable +# calls keep independent gates even when the caller omits the optional ref. concurrency: - group: test-${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'workflow_call' && github.run_id || github.ref }} - cancel-in-progress: ${{ github.event_name != 'workflow_call' }} + group: test-${{ github.workflow }}-${{ github.event_name }}-${{ inputs.preserve_run && github.run_id || github.ref }} + cancel-in-progress: ${{ !inputs.preserve_run }} jobs: unix: @@ -64,7 +69,7 @@ jobs: - name: Install checkout prerequisites run: | apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates git + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl git jq - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ inputs.ref || github.ref }} diff --git a/AGENTS.md b/AGENTS.md index 157ce06..5e82ab9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,40 +6,35 @@ Read `.ai/memory/MEMORY.md` only when prior context is relevant. ## CI, cost and documentation -- Use **Blacksmith** runners for supported GitHub Actions CI. Check the current - [runner documentation](https://docs.blacksmith.sh/blacksmith-runners/overview) - and repository access before selecting labels. Preserve required checks and - native platform coverage; retain an existing gate until its replacement proves - equivalent coverage for the same source. Record any provider exception. -- Minimize total cost across CI, hosting, storage, network, APIs, AI and tooling. - Choose the least costly option that meets the task's quality, security, - reliability and performance requirements. Preserve mandated models and gates; - never trade away correctness, coverage, accessibility or data safety for price. -- Use the fewest hosted CI runs that still cover changed paths, scheduled - checks and required gates. Iterate locally, route jobs by scope, reuse valid - caches, avoid duplicate runs and bound retries/concurrency. Cancel superseded - verification when safe; review releases and migrations before cancellation. - Preserve checks for the exact commit and native platforms. Measure usage, expire disposable - artifacts and retire only verified idle resources within task authority. -- Keep Markdown focused: one canonical home per topic, short sections and useful - links. Keep commands and safeguards near their use; move detailed history to - dated evidence. Update stale guidance against code, preserve release records, - and avoid duplicating this policy in every document. +Read `~/dev/AGENTS.md` for shared checkout, cost, documentation and storage rules. + +- Iterate locally; run the applicable full local gate before release. Hosted + CI is only for necessary final public/customer production verification, + never routine work, draft PRs, previews or unshipped instruction/doc maintenance. Local + scripts named `ci` remain local; do not push merely to trigger CI. +- Run the fewest required hosted jobs. Reuse only evidence for the exact final + SHA, artifacts and config; revalidate after changes. Fix every candidate/gate + failure and material warning, then rerun until all applicable checks pass. + Pending, canceled, blocked, timed out and unexpected skips are not passes; + path skips require workflow evidence. Never weaken tests/coverage or retry blindly. +- Check automatic triggers and gate publication on successful verification. + Preserve required statuses, branch protection, scheduled security/ops checks, + native acceptance and approvals; record proof and verify after deployment. + No hosted CI means retain local/manual gates. Changes to automation or + publication need task authority. Avoid duplicate providers/runs. + +**Project gate:** For instruction maintenance, run `node scripts/check-docs.mjs` locally. For +public launcher/installer releases, finish applicable Unix/PowerShell and npm +checks, then require the final platform, minimum Node, legacy Linux and archive +matrix plus applicable security gates. Tags can trigger release publication; +use the existing gated release flow and exact asset hashes for downstream +manifests. Do not manually repeat the matrix for ordinary development. ## What this is -Claudex is an open source compatibility layer that lets Codex GPT models and -native Claude models run through the Claude Code terminal interface. Managed -GPT sessions reuse an existing local Codex login, run a pinned, verified -CLIProxyAPI binary bound to `127.0.0.1`, and launch an isolated Claude Code -profile pointed at that proxy. Native Claude model routes use the caller owned -Claude profile in a separate process after managed routing is removed. -Fableplan uses a native read only Fable planner and an isolated managed Terra -implementer, transferring only bounded plan text through a private temporary -file. Claudex does not fork or patch the signed Claude Code executable: it is a -launcher/wrapper, distributed as Bash + PowerShell scripts. +Claudex runs Codex GPT and native Claude models through the Claude Code terminal interface without modifying its signed binary. GPT uses existing Codex login, a pinned/verified CLIProxyAPI bound to `127.0.0.1` and isolated Claude profile; native Claude uses the caller profile in a separate process after managed routing is removed. Fableplan passes bounded plan text through a private temporary file from a native read only Fable planner to an isolated managed Terra implementer. Distribution: Bash + PowerShell wrappers. -Production code is intentionally dependency light: Bash, PowerShell, a small Node preload module, and JSON. There is no application build step or bundler. +Runtime: Bash, PowerShell, one Node preload and JSON; no bundler or application build. ## Commands @@ -62,13 +57,18 @@ node tests/skill-bridge.test.cjs # discovery/materialization behavior node tests/skill-contract.test.cjs # Claude/Codex compatibility contract node tests/skill-security.test.cjs # hostile filesystem/plugin inputs bash -n claudex codex-session install.sh statusline usage-limit -zsh -n test.zsh +bash -n test.zsh git diff --check ``` -There is no single test runner: `test.zsh`/`test.ps1` are one large suite of isolated regressions using fake homes and fake provider commands (Codex, Claude Code, curl, CLIProxyAPI) so tests never touch a real session. To narrow scope while iterating, grep the suite file for the relevant test function name and read it directly; there's no `--filter` flag. +`test.zsh`/`test.ps1` are isolated suites using fake homes/providers, never real sessions. For focused work, read the relevant function directly; no `--filter` exists. -CI (`.github/workflows/test.yml`) runs on every push to `main` and every PR: the Unix suite on macOS + Ubuntu, the PowerShell suite on Windows, plus three Ubuntu jobs: `package-artifacts` (`npm test` + `scripts/check-release-artifacts.sh`), `node-18-shared-runtime` (`npm test` on the minimum supported Node), and `legacy-linux-node` (managed Node fallback in an Ubuntu 20.04 container). +CI (`.github/workflows/test.yml`) runs on every push to `main` and every PR: +the Unix suite on macOS + Ubuntu, the PowerShell suite on Windows, plus three +Ubuntu jobs: `package-artifacts` (package metadata and reproducible archive +checks), `node-18-shared-runtime` (`npm test` on the minimum supported Node), +and `legacy-linux-node` (managed Node fallback in an Ubuntu 20.04 container). +Current runner selection and its cost exception are in `docs/development.md`. ## Architecture @@ -99,23 +99,23 @@ sessions, and billing contexts never cross that boundary. | Skill bridge | `skill-bridge.cjs` | shared | Snapshot and adapt existing Claude/Codex skills and plugin skills without activating source plugin code | | Settings template | `settings.json` | shared | Isolated default Claude Code settings written into the managed config | -Every shared behavior change must touch both the Bash and PowerShell implementation (`claudex`/`claudex.ps1`, `codex-session`/`codex-session.ps1`, etc.): platform drift is treated as a bug unless the underlying OS genuinely lacks the feature, in which case the boundary must be documented, not silently emulated. +Shared changes must update both Unix and Windows: `claudex`/`claudex.ps1`, `codex-session`/`codex-session.ps1`, etc. Platform drift is a bug; document genuine OS limitations instead of emulating silently. ### Authentication lifecycle -Codex owns the actual login/logout UX. Claudex only verifies `codex login status`, reads the file backed ChatGPT session from the standard Codex location, and atomically writes the minimum fields CLIProxyAPI needs into Claudex's private credential directory (restrictive permissions). A background watcher fingerprints the standard Codex credential file for the life of a proxied session and re syncs on account changes, clearing any cached usage snapshot/account selection so stale account data can't leak into the footer. Logout always tears down the bridge even if the upstream logout call fails. +Codex owns login/logout. Claudex checks `codex login status` and atomically copies only required session fields into a private credential directory with restrictive permissions. A watcher fingerprints Codex credentials throughout a proxied session, resyncs on account changes and clears cached usage/account selection. Logout tears down the bridge even if upstream logout fails. ### Usage limit flow -The status line never blocks on network I/O: it reads a sanitized cached summary and triggers a bounded background refresh when stale. Detailed usage comes from the authenticated web endpoint, falling back to the Codex app server `account/rateLimits/read` interface (fallback disabled while a specific bridge account is explicitly selected, since app server may represent a different account). Identity/credential fields are stripped before any snapshot is written to disk. +The status line reads a sanitized cache and starts bounded background refresh, never blocking on network I/O. Detailed usage prefers the authenticated web endpoint, then Codex app server `account/rateLimits/read`; disable fallback while a bridge account is selected to avoid another account's data. Strip identity/credentials before persisting snapshots. ### Context stabilization -Claude Code can emit zero/missing context data transiently during startup and compaction. The status line stores the last trustworthy context percentage per session and reuses only that session's own last known value: never a false zero, and sub-1% usage renders as `<1%`. +Cache the last trustworthy context percentage per session through transient zero/missing startup or compaction data. Never invent zero or share sessions; values below 1% display `<1%`. ### Update and compatibility strategy -At every launch, `claudex` reads `claude --help` and only injects flags Claude Code actually supports; unrecognized arguments are passed through unchanged. The installer does a best effort Claude Code update; the launcher re checks on a configurable interval without blocking startup, recovers stale lock directories, and avoids racing an explicit update command. Claudex also updates itself: `claudex self-update` runs the installed helper directly, and unless `CLAUDEX_AUTO_UPDATE` is off the launcher spawns that helper as a background check. The CLIProxyAPI dependency is pinned by version and SHA-256 per OS/arch pair and verified at install time: never vendored into the repo. +At launch, read `claude --help`, inject only supported flags and pass unknown arguments unchanged. Install/update Claude Code on a best effort basis; bounded configurable checks must not block startup or race explicit updates, and stale locks must recover. `claudex self-update` runs its helper; the launcher checks it in the background unless `CLAUDEX_AUTO_UPDATE` is off. CLIProxyAPI stays version/SHA-256 pinned for every OS/arch, verified at install and never vendored. ### Trust boundaries @@ -140,7 +140,7 @@ At every launch, `claudex` reads `claude --help` and only injects flags Claude C 8. Fail clearly when an essential upstream interface is unavailable: no silent degradation. 9. Add a regression test before considering a bug fixed. -Updating the CLIProxyAPI pin is security sensitive: collect every macOS/Linux/Windows x64/ARM64 asset from the official upstream release, compute each digest independently, update both installers together, and run the full platform test matrix. Never replace a digest just to make a failed download pass. +For CLIProxyAPI pin updates, fetch all official macOS/Linux/Windows x64/ARM64 assets, independently hash them, update both installers and pass the full platform matrix. Never replace a digest to conceal a bad download. ## Repository layout @@ -163,24 +163,23 @@ Updating the CLIProxyAPI pin is security sensitive: collect every macOS/Linux/Wi ## Configuration model -The installer writes private runtime config to `~/.config/claudex/env`; `env.example` documents supported overrides (model aliases, permission mode, concurrency/retry limits, context window/compaction thresholds, usage display cadence, proxy URL/token/binary path, auto update behavior). See `docs/configuration.md` for the full variable table: don't hardcode defaults elsewhere without checking there first, since values like the default model ID or context window change between releases. +Private config: `~/.config/claudex/env`; `env.example` documents model, permission, retry/concurrency, context, usage, proxy and update overrides. Check `docs/configuration.md` before reusing defaults or model IDs. ## Releasing -Maintainers release from a clean `main` after CI passes: bump `CHANGELOG.md` (Unreleased -> SemVer version, kept in sync with `package.json`), tag `vMAJOR.MINOR.PATCH`, push the tag, publish a GitHub Release, then update the Homebrew tap / Scoop bucket / WinGet manifest with the exact release asset hashes. +Release clean `main` after CI passes: align `CHANGELOG.md` and `package.json`, turn Unreleased into SemVer, tag/push `vMAJOR.MINOR.PATCH`, publish GitHub Release, then update Homebrew/Scoop/WinGet with exact asset hashes. -## Local storage hygiene - -- Run `/Users/HP/dev/storage-maintenance --report` before and after work likely - to generate more than 1 GiB. Follow `/Users/HP/dev/STORAGE_HYGIENE.md`. -- Keep disposable staging under `$TMPDIR` or `/private/tmp`; remove it normally, - or register verified staging outside Git after verifying uploaded or released bytes: - `storage-maintenance --register PATH --ttl-days 3`. Keep hashes, URLs, - versions and receipts instead of duplicate binaries. -- Remove clean, merged worktrees through Git. Preserve dirty/unmerged work and - history; under pressure remove only reproducible dependencies from such work. -- Never delete others' work, browser profiles, application databases, Docker - volumes, cloud drive or personal data. Chrome/Google and Zoom are protected. - Do not add cleanup daemons or install from the orphaned home `package.json`. +## Storage + +- For work generating >1 GiB, run `/Users/HP/dev/storage-maintenance --report` + before/after and follow `/Users/HP/dev/STORAGE_HYGIENE.md`. +- Stage under `$TMPDIR` or `/private/tmp`; clean up normally or register verified + staging outside Git with `storage-maintenance --register PATH --ttl-days 3`. + Keep hashes/URLs/versions/receipts instead of duplicate binaries. +- Remove only clean, merged worktrees through Git; preserve dirty/unmerged work + and history. Under pressure, remove only reproducible dependencies from them. +- Preserve others' work, browser profiles (Chrome/Google), Zoom, app databases, + Docker volumes, cloud drive and personal data. No cleanup daemons or installs + from the orphaned home `package.json`. diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ad564..fd050ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ uses [Semantic Versioning](https://semver.org/) for tagged releases. ## [Unreleased] +## [1.6.3] - 2026-09-26 + +### Changed + +- Reduced redundant pull request verification and repeated legacy Linux setup + while retaining native platform, security, and release checks. + +### Fixed + +- Stabilized asynchronous status refresh and Windows self update lock test + fixtures on slower CI hosts. + ## [1.6.2] - 2026-07-22 ### Added @@ -490,7 +502,8 @@ uses [Semantic Versioning](https://semver.org/) for tagged releases. - Claude in Chrome first party profile support. - Cross platform regression coverage in GitHub Actions. -[Unreleased]: https://github.com/BeamoINT/Claudex/compare/v1.6.2...HEAD +[Unreleased]: https://github.com/BeamoINT/Claudex/compare/v1.6.3...HEAD +[1.6.3]: https://github.com/BeamoINT/Claudex/compare/v1.6.2...v1.6.3 [1.6.2]: https://github.com/BeamoINT/Claudex/compare/v1.6.1...v1.6.2 [1.6.1]: https://github.com/BeamoINT/Claudex/compare/v1.6.0...v1.6.1 [1.6.0]: https://github.com/BeamoINT/Claudex/compare/v1.5.8...v1.6.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d4958f9..42cbb31 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,7 +98,7 @@ platform: ```bash node --check preload.cjs bash -n claudex codex-session install.sh statusline usage-limit -zsh -n test.zsh +bash -n test.zsh ``` GitHub Actions runs the complete isolated suite on macOS, Ubuntu, and Windows. diff --git a/docs/development.md b/docs/development.md index a19c781..f26fb9d 100644 --- a/docs/development.md +++ b/docs/development.md @@ -46,9 +46,16 @@ Node.js 18 runtime. The hosted matrix does not currently include ARM64 or WSL; the root README distinguishes those supported paths from configurations tested on hosted runners. +Claudex is public, so [standard GitHub runners incur no Actions minute charges](https://docs.github.com/en/actions/concepts/billing-and-usage). +The current jobs use those runners. This is the cost exception to the workspace +preference for Blacksmith: the [last Blacksmith matrix](https://github.com/BeamoTech/Claudex/actions/runs/35803572683) +waited nearly three hours for its macOS job, while the [current GitHub matrix](https://github.com/BeamoTech/Claudex/actions/runs/36283161738) +started that job within seconds. Recheck repository visibility, runner access, +queue time, and exact source coverage before changing providers. + CodeQL scans the JavaScript compatibility surface on every pull request and on a weekly schedule. Dependency Review blocks newly introduced high or critical -dependency vulnerabilities, Dependabot proposes pinned dependency updates, and +dependency vulnerabilities, and the pull request labeler identifies affected components and platforms. All third party GitHub Actions are pinned to immutable commits. @@ -61,7 +68,7 @@ Useful focused checks: node scripts/check-docs.mjs node --check preload.cjs bash -n claudex codex-session install.sh statusline usage-limit -zsh -n test.zsh +bash -n test.zsh git diff --check ``` diff --git a/package-lock.json b/package-lock.json index 81c42d0..4f8661f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "claudex-codex", - "version": "1.6.2", + "version": "1.6.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "claudex-codex", - "version": "1.6.2", + "version": "1.6.3", "license": "MIT", "engines": { "node": ">=18" diff --git a/package.json b/package.json index 5d13240..4aac13b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "claudex-codex", - "version": "1.6.2", + "version": "1.6.3", "private": true, "description": "Cross platform compatibility layer for using Codex GPT and native Claude models through Claude Code", "type": "module", diff --git a/test.ps1 b/test.ps1 index 33f0a47..e4ee1be 100644 --- a/test.ps1 +++ b/test.ps1 @@ -2977,12 +2977,14 @@ process.stdout.write(JSON.stringify({ [IO.Directory]::CreateDirectory($statusRefreshConfig) | Out-Null [IO.File]::WriteAllText($statusRefreshHelper, @' param([switch] $RefreshCache, [switch] $LockHeld, [string] $LockToken) -[IO.File]::WriteAllLines($env:STATUS_REFRESH_PRIVATE_ENV_LOG, @( +$pendingLog = "$env:STATUS_REFRESH_PRIVATE_ENV_LOG.$PID.pending" +[IO.File]::WriteAllLines($pendingLog, @( "MANTLE=$env:ANTHROPIC_BEDROCK_MANTLE_BASE_URL", "VERTEX_PROJECT=$env:ANTHROPIC_VERTEX_PROJECT_ID", "FOUNDRY_RESOURCE=$env:ANTHROPIC_FOUNDRY_RESOURCE", "FOUNDRY_API_KEY=$env:ANTHROPIC_FOUNDRY_API_KEY" )) +[IO.File]::Move($pendingLog, $env:STATUS_REFRESH_PRIVATE_ENV_LOG) '@, $utf8) $statusRefreshEnvironment = @{} foreach ($statusRefreshName in @( @@ -3001,10 +3003,16 @@ param([switch] $RefreshCache, [switch] $LockHeld, [string] $LockToken) $env:ANTHROPIC_FOUNDRY_RESOURCE = 'private-foundry-resource' $env:ANTHROPIC_FOUNDRY_API_KEY = 'private-foundry-secret' '{"session_id":"private-refresh","model":{"id":"gpt-5.6-sol"},"context_window":{"used_percentage":5}}' | & (Join-Path $root 'statusline.ps1') | Out-Null - for ($attempt = 0; $attempt -lt 100 -and -not (Test-Path -LiteralPath $statusRefreshLog -PathType Leaf); $attempt++) { + $statusRefreshLines = @() + $statusRefreshDeadline = [DateTime]::UtcNow.AddSeconds(20) + while ($statusRefreshLines.Count -lt 4 -and [DateTime]::UtcNow -lt $statusRefreshDeadline) { + if (Test-Path -LiteralPath $statusRefreshLog -PathType Leaf) { + try { $statusRefreshLines = @([IO.File]::ReadAllLines($statusRefreshLog)) } catch [IO.IOException] { } + } + if ($statusRefreshLines.Count -ge 4) { break } Start-Sleep -Milliseconds 20 } - $statusRefreshLines = @([IO.File]::ReadAllLines($statusRefreshLog)) + Assert-True ($statusRefreshLines.Count -eq 4) 'status refresh helper writes a complete environment log' Assert-True (($statusRefreshLines -join '|') -eq 'MANTLE=|VERTEX_PROJECT=|FOUNDRY_RESOURCE=|FOUNDRY_API_KEY=') 'status refresh helper receives no private cloud-provider environment' } finally { foreach ($statusRefreshName in $statusRefreshEnvironment.Keys) { diff --git a/test.zsh b/test.zsh index 8824be6..58d3bf4 100755 --- a/test.zsh +++ b/test.zsh @@ -1762,7 +1762,14 @@ printf '%s\n' '{"session_id":"private-refresh","model":{"id":"gpt-5.6-sol"},"con ANTHROPIC_FOUNDRY_RESOURCE='private-foundry-resource' \ ANTHROPIC_FOUNDRY_API_KEY='private-foundry-secret' \ "$root/statusline" >/dev/null -for _ in {1..100}; do [[ -s "$status_refresh_log" ]] && break; sleep 0.02; done +# Refresh runs in the background. Wait for all four lines before reading the +# helper's evidence so loaded hosts cannot expose a partial write. +for _ in {1..1000}; do + if [[ -s "$status_refresh_log" ]] && [[ $(wc -l < "$status_refresh_log") -ge 4 ]]; then break; fi + sleep 0.02 +done +[[ -s "$status_refresh_log" ]] || { printf '%s\n' 'status refresh helper did not write its environment log' >&2; exit 1; } +[[ $(wc -l < "$status_refresh_log") -eq 4 ]] || { printf '%s\n' 'status refresh helper wrote an incomplete environment log' >&2; exit 1; } [[ "$(<"$status_refresh_log")" == $'MANTLE=\nVERTEX_PROJECT=\nFOUNDRY_RESOURCE=\nFOUNDRY_API_KEY=' ]] printf '%s\n' 'Codex 7d 16% left · Review 7d 9% left · Extra-long-capacity-window 30d 8% left' \ diff --git a/tests/legacy-linux-node.sh b/tests/legacy-linux-node.sh index 58cac05..87c18c0 100755 --- a/tests/legacy-linux-node.sh +++ b/tests/legacy-linux-node.sh @@ -6,8 +6,13 @@ readonly temporary="$(mktemp -d)" trap 'rm -rf "$temporary"' EXIT [[ "$(id -u)" == 0 ]] || { printf '%s\n' 'legacy Linux runtime test must run as root in a disposable container' >&2; exit 1; } -apt-get update >/dev/null -DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates curl jq >/dev/null +# CI installs these before checkout. Standalone container runs still install +# missing tools, but an already prepared runner avoids a second apt index fetch. +if ! command -v curl >/dev/null 2>&1 || ! command -v jq >/dev/null 2>&1 || \ + [[ ! -s /etc/ssl/certs/ca-certificates.crt ]]; then + apt-get update >/dev/null + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl jq >/dev/null +fi home="$temporary/home" fake_bin="$temporary/bin" diff --git a/tests/self-update-lock-regressions.ps1 b/tests/self-update-lock-regressions.ps1 index bf8d3b5..d7e2e5b 100644 --- a/tests/self-update-lock-regressions.ps1 +++ b/tests/self-update-lock-regressions.ps1 @@ -12,6 +12,10 @@ $shell = (Get-Process -Id $PID).Path $isWindowsPlatform = [Environment]::OSVersion.Platform -eq [PlatformID]::Win32NT $scriptPath = Join-Path $root 'self-update.ps1' $arguments = @('-NoLogo', '-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', ('"' + $scriptPath + '"'), '-Check') +# Native PowerShell startup and lock recovery can exceed 15 seconds on a busy +# runner. The wait remains bounded, and cleanup terminates any timed out child. +$exitTimeoutMs = 45000 +$script:startedChecks = @() function Assert-True([bool] $Condition, [string] $Message) { if (-not $Condition) { throw "assertion failed: $Message" } @@ -50,7 +54,9 @@ function Start-Check { PassThru = $true } if ($isWindowsPlatform) { $parameters.WindowStyle = 'Hidden' } - return Start-Process @parameters + $process = Start-Process @parameters + $script:startedChecks += $process + return $process } function Invoke-ExpectedFailedCheck { @@ -121,10 +127,10 @@ try { Wait-File (Join-Path $temporary 'b-ready') $bNonce = ([IO.File]::ReadAllLines((Join-Path $lock 'owner')) | Where-Object { $_.StartsWith('nonce=') })[0] Continue-Pause 'a' - Assert-True ($a.WaitForExit(15000)) 'paused A exits' + Assert-True ($a.WaitForExit($exitTimeoutMs)) 'paused A exits' Assert-True ([IO.File]::ReadAllText((Join-Path $lock 'owner')).Contains($bNonce)) 'A preserves B generation' Continue-Pause 'b' - Assert-True ($b.WaitForExit(15000)) 'B exits' + Assert-True ($b.WaitForExit($exitTimeoutMs)) 'B exits' Assert-True (-not (Test-Path -LiteralPath $lock)) 'B releases exact generation' # A new creator can resume inside a replacement lock published by the old @@ -139,7 +145,7 @@ try { [IO.File]::WriteAllText((Join-Path $lock 'owner.json'), "{`"pid`":$PID,`"token`":`"legacy-b`"}`n", $utf8) Remove-Item -LiteralPath (Join-Path $update 'abandoned-mixed-a') -Recurse -Force Continue-Pause 'mixed-a' - Assert-True ($mixedA.WaitForExit(15000) -and $mixedA.ExitCode -ne 0) 'mixed protocol A exits outside update section' + Assert-True ($mixedA.WaitForExit($exitTimeoutMs) -and $mixedA.ExitCode -ne 0) 'mixed protocol A exits outside update section' Assert-True ([IO.File]::ReadAllText((Join-Path $lock 'owner.json')).Contains('legacy-b')) 'mixed protocol A preserves legacy B owner' Assert-True (-not (Test-Path -LiteralPath (Join-Path $lock 'generation'))) 'mixed protocol A withdraws only its injected generation' Assert-True (@(Get-ChildItem -LiteralPath $update -Directory -Filter 'lock.quarantine.*' -ErrorAction SilentlyContinue).Count -eq 0) 'mixed protocol cleanup leaves no barrier' @@ -160,7 +166,7 @@ try { (Get-Item -LiteralPath $lock).CreationTimeUtc = $abandonedCreationTime Remove-Item -LiteralPath (Join-Path $update 'abandoned-empty-b-a') -Recurse -Force Continue-Pause 'empty-b' - Assert-True ($emptyBA.WaitForExit(15000) -and $emptyBA.ExitCode -ne 0) 'A rejects an empty replacement directory' + Assert-True ($emptyBA.WaitForExit($exitTimeoutMs) -and $emptyBA.ExitCode -ne 0) 'A rejects an empty replacement directory' Assert-True ((Test-Path -LiteralPath $lock -PathType Container) -and -not (Test-Path -LiteralPath (Join-Path $lock 'generation')) -and -not (Test-Path -LiteralPath (Join-Path $lock 'owner'))) 'A preserves B before legacy owner publication' @@ -203,7 +209,7 @@ try { Continue-Pause 'x-before' Wait-File (Join-Path $temporary 'x-after-ready') $z = Start-Check - Assert-True ($z.WaitForExit(15000) -and $z.ExitCode -ne 0) 'Z remains outside quarantined update section' + Assert-True ($z.WaitForExit($exitTimeoutMs) -and $z.ExitCode -ne 0) 'Z remains outside quarantined update section' Continue-Pause 'x-after' for ($attempt = 0; $attempt -lt 500; $attempt++) { if ((Test-Path -LiteralPath (Join-Path $lock 'owner')) -and [IO.File]::ReadAllText((Join-Path $lock 'owner')).Contains($yNonce)) { break } @@ -211,15 +217,19 @@ try { } Assert-True ([IO.File]::ReadAllText((Join-Path $lock 'owner')).Contains($yNonce)) 'X restores exact moved Y nonce' Continue-Pause 'y' - Assert-True ($y.WaitForExit(15000)) 'Y exits' - Assert-True ($x.WaitForExit(15000)) 'X exits' + Assert-True ($y.WaitForExit($exitTimeoutMs) -and $y.ExitCode -eq 0) 'Y exits successfully after recovering its lock' + Assert-True ($x.WaitForExit($exitTimeoutMs)) 'X exits' # Hardlink denial falls back to CreateNew and an incomplete publication is - # withdrawn without leaving an owner or quarantine barrier. + # withdrawn without leaving an owner or quarantine barrier. A just exited + # race participant can leave a dead lock within the two second grace, so + # this successful acquisition uses the normal retry budget. + $env:CLAUDEX_TEST_UPDATE_LOCK_ATTEMPTS = '100' $env:CLAUDEX_TEST_FORCE_HARDLINK_FAILURE = '1' & $shell -NoLogo -NoProfile -ExecutionPolicy Bypass -File $scriptPath -Check | Out-Null Assert-True ($LASTEXITCODE -eq 0 -and -not (Test-Path -LiteralPath $lock)) 'CreateNew fallback succeeds' Remove-Item Env:CLAUDEX_TEST_FORCE_HARDLINK_FAILURE + $env:CLAUDEX_TEST_UPDATE_LOCK_ATTEMPTS = '12' $env:CLAUDEX_TEST_FORCE_PUBLICATION_FAILURE = '1' $publicationFailureExit = Invoke-ExpectedFailedCheck Assert-True ($publicationFailureExit -ne 0 -and -not (Test-Path -LiteralPath $lock)) 'incomplete publication is removed' @@ -273,11 +283,20 @@ try { $identity = [string] (Get-Process -Id $PID).StartTime.ToUniversalTime().Ticks [IO.File]::WriteAllText((Join-Path $lock 'owner'), "pid=$PID`nidentity=$identity`nnonce=replacement`n", $utf8) Continue-Pause 'exit' - Assert-True ($oldOwner.WaitForExit(15000)) 'obsolete owner exits' + Assert-True ($oldOwner.WaitForExit($exitTimeoutMs)) 'obsolete owner exits' Assert-True ([IO.File]::ReadAllText((Join-Path $lock 'owner')).Contains('nonce=replacement')) 'exit hook preserves replacement generation' [Console]::WriteLine('PowerShell self update lock regressions passed') } finally { + foreach ($check in $script:startedChecks) { + try { + if (-not $check.HasExited) { + $check.Kill() + [void] $check.WaitForExit(5000) + } + } catch { } + try { $check.Dispose() } catch { } + } foreach ($name in @('CLAUDEX_CONFIG_DIR', 'CLAUDEX_TEST_MODE', 'CLAUDEX_TEST_UPDATE_FIXTURE_DIR', 'CLAUDEX_TEST_UPDATE_LOCK_ATTEMPTS', 'CLAUDEX_TEST_FORCE_HARDLINK_FAILURE', 'CLAUDEX_TEST_FORCE_PUBLICATION_FAILURE')) { Remove-Item -LiteralPath "Env:$name" -ErrorAction SilentlyContinue From 662d0c3b4b0e4b08268ea82a364228ec91a4eb1c Mon Sep 17 00:00:00 2001 From: BeamoINT Date: Sat, 3 Oct 2026 15:28:02 -0500 Subject: [PATCH 2/3] docs: correct the canonical agent guide discovery rule --- .cursor/rules/ai-memory.mdc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cursor/rules/ai-memory.mdc b/.cursor/rules/ai-memory.mdc index 6f6d5a8..b6f5c4d 100644 --- a/.cursor/rules/ai-memory.mdc +++ b/.cursor/rules/ai-memory.mdc @@ -3,7 +3,7 @@ description: Durable .ai/memory index for Cursor CLI and editor. Always apply so alwaysApply: true --- -Follow `AGENTS.md` as the source of truth for this repository (Claudex: follow `AGENTS.md`; `AGENTS.md` is only a pointer). +Follow `AGENTS.md` as the sole project instruction file. Durable facts live in `.ai/memory/`. Read `.ai/memory/MEMORY.md` first, then open only the relevant notes. Memories are point-in-time observations; verify drift-prone claims against current code. From 1b2d44e475a86e2068f24e283be0ead73ae9dab9 Mon Sep 17 00:00:00 2001 From: BeamoINT Date: Sat, 3 Oct 2026 15:48:50 -0500 Subject: [PATCH 3/3] docs: clarify automatic PR checks and standalone guidance --- AGENTS.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5e82ab9..48cdba8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,12 +6,18 @@ Read `.ai/memory/MEMORY.md` only when prior context is relevant. ## CI, cost and documentation -Read `~/dev/AGENTS.md` for shared checkout, cost, documentation and storage rules. +When present, read `~/dev/AGENTS.md` for workspace rules. This guide also applies +to standalone checkouts. Follow the repository's mandated CI provider; otherwise +prefer verified free Cloud Build, then CodeBuild, then Blacksmith. Include shared +usage, machine, logging, storage and network costs with headroom; never reduce +verification or security to save cost. Keep one document per topic and link detail. - Iterate locally; run the applicable full local gate before release. Hosted CI is only for necessary final public/customer production verification, - never routine work, draft PRs, previews or unshipped instruction/doc maintenance. Local - scripts named `ci` remain local; do not push merely to trigger CI. + do not manually trigger it for routine work, draft PRs, previews or unshipped + instruction/doc maintenance. Authorized PRs/pushes still require their automatic + checks; never disable or bypass them. Local scripts named `ci` remain local; + do not push merely to trigger CI. - Run the fewest required hosted jobs. Reuse only evidence for the exact final SHA, artifacts and config; revalidate after changes. Fix every candidate/gate failure and material warning, then rerun until all applicable checks pass.