-
Notifications
You must be signed in to change notification settings - Fork 0
Make co-evolve usable through init and bounce subcommands #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
b598bf4
3e70c7d
aaa86e0
1f8cf6f
06f496f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Plan: Next | ||
|
|
||
| Product features only, priority order, from the last committed ROADMAP.md | ||
| (`.planning/` is owned by another writer and not touched here). Audit, | ||
| calibration, and dogfood-evidence phases (v1.2 SC-4, v1.3 bounce | ||
| calibration, v1.5 Phase 6 evidence-gathering) are excluded — done, or not | ||
| a feature. | ||
|
|
||
| 1. Publish `@alanshurafa/co-evolution-mcp` to npm (v1.4 Phase 5) — done when `npm install -g @alanshurafa/co-evolution-mcp` works and `co_evolve` responds from an external MCP client (Claude Desktop/Cursor/Continue). | ||
| - 2026-09-12 OPERATOR: npm package lookup returned E404, npm identity returned E401, and no GitHub publishing secret exists; Alan must authenticate and publish using mcp/PUBLISH.md, then exercise the registry install and `co-evolve --help` (the current goal's acceptance condition). | ||
| 2. Submit the MCP server to the MCP registry and open the awesome-mcp-list PR (v1.4 Phase 6) — done when the registry listing is live or the PR is merged. | ||
| - 2026-09-12 MERGED: https://github.com/alanshurafa/co-evolution/pull/69 records https://github.com/punkpeye/awesome-mcp-servers/pull/14263; observed the public submission in OPEN state with the source-linked server entry (the current goal requires an open submission, not upstream merge). | ||
| 3. Give `co-evolve` a real subcommand CLI (`co-evolve bounce <file>`, `co-evolve init`) instead of positional-only flags — done when both subcommands run against a fresh checkout without reading the script source. | ||
| - 2026-09-12: Added source and npm `init`/`bounce` commands; installed the local tarball, observed help and sample creation, then two real Codex passes exited 0 with a critique of same-device backups and a revised plan with separate storage and restore tests; raw critiques, markers, state, and reports remain in the run artifacts. Registry installation remains item 1's operator step. | ||
| 4. Add one more agent adapter beyond Claude/Codex (Gemini CLI, Ollama, or a direct API call) — done when a bounce completes end-to-end using the new adapter for at least one side. | ||
| 5. Write the standalone Bounce Protocol spec (markers, convergence rules, role lenses) independent of any single runner's code — done when a new agent adapter can be built from the spec alone, without reading `co-evolve-bouncer.sh`. | ||
| 6. Ship the automated branch/worktree cleanup utility carried forward from v1.1 — done when a single command removes worktrees/branches left by completed `dev-review` runs. | ||
| 7. PEL Option 2 (Auto-Promote, `lab/pel-auto/`) — done when a mutation that passes canary and beats the champion on eval auto-merges under an explicit opt-in flag, no PR review step. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| usage() { | ||
| cat <<'USAGE' | ||
| Usage: co-evolve <command> [options] | ||
|
|
||
| Commands: | ||
| init [file] Create a sample Markdown document (default: sample.md). | ||
| bounce <file> [opts] Refine a document; preserve input and run artifacts. | ||
| help Show this usage. | ||
|
|
||
| Quick start: | ||
| co-evolve init | ||
| co-evolve bounce sample.md --agents codex,codex --output sample.bounced.md | ||
|
|
||
| Bounce defaults: two passes, Claude reviewer and Codex composer, no interview. | ||
| Both selected agent CLIs must be installed and logged in. To use only Codex, | ||
| pass --agents codex,codex. Run artifacts go to .co-evolve/runs in the current | ||
| directory; set CO_EVOLVE_RUNS_DIR to choose another directory. | ||
|
|
||
| Use co-evolve bounce --help for all runner options. Legacy positional input | ||
| and flags still work. The judge is opt-in; behavior scores are informational. | ||
| USAGE | ||
| } | ||
|
|
||
| case "${1:-help}" in | ||
| help|--help|-h) usage ;; | ||
| init) | ||
| shift | ||
| if [[ "${1:-}" == --help || "${1:-}" == -h ]]; then usage; exit 0; fi | ||
| [[ $# -le 1 ]] || { echo 'Usage: co-evolve init [file]' >&2; exit 2; } | ||
| target="${1:-sample.md}" | ||
| # noclobber also protects an existing file if another init races this one. | ||
| if ! (set -o noclobber; cat > "$target" <<'SAMPLE' | ||
| # A small team's backup plan | ||
|
|
||
| We keep our only backup on the same laptop as the original files. A weekly | ||
| copy is enough because the laptop has never failed. Everyone can overwrite | ||
| the backup to save time. We will know the backups work when no one complains. | ||
|
|
||
| Improve this plan for a three-person team. Keep it under 250 words. Address | ||
| recovery, access, and a concrete way to prove that a backup can be restored. | ||
| SAMPLE | ||
| ); then | ||
| echo "Could not create $target; choose a new file in an existing directory." >&2 | ||
| exit 1 | ||
| fi | ||
| printf 'Created %s\nNext: co-evolve bounce "%s" --agents codex,codex\n' "$target" "$target" | ||
| ;; | ||
| bounce) | ||
| shift | ||
| if [[ "${1:-}" == --help || "${1:-}" == -h ]]; then | ||
| exec bash "$ROOT/co-evolve-bouncer.sh" --help | ||
| fi | ||
| [[ $# -gt 0 && -f "$1" ]] || { echo 'Usage: co-evolve bounce <existing-file> [options]' >&2; exit 2; } | ||
| input="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" | ||
| shift | ||
| export CO_EVOLVE_RUNS_DIR="${CO_EVOLVE_RUNS_DIR:-$PWD/.co-evolve/runs}" | ||
| exec bash "$ROOT/co-evolve-bouncer.sh" --vanilla --bounce-only "$@" -- "$input" | ||
| ;; | ||
| *) exec bash "$ROOT/co-evolve-bouncer.sh" "$@" ;; | ||
| esac | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -761,9 +761,9 @@ invoke_codex() { | |
| if [[ -n "${WSL_DISTRO_NAME:-}" ]] && command -v cmd.exe >/dev/null 2>&1 && command -v wslpath >/dev/null 2>&1; then | ||
| windows_workdir=$(wslpath -w "$workdir") | ||
| windows_output=$(wslpath -w "$output_file") | ||
| cmd=(cmd.exe /c codex exec --full-auto --skip-git-repo-check -C "$windows_workdir") | ||
| cmd=(cmd.exe /c codex exec --approve-for-me --skip-git-repo-check -C "$windows_workdir") | ||
| else | ||
| cmd=(codex exec --full-auto --skip-git-repo-check -C "$workdir") | ||
| cmd=(codex exec --approve-for-me --skip-git-repo-check -C "$workdir") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With Codex CLI 0.144.0-alpha.4, AGENTS.md reference: AGENTS.md:L72-L72 Useful? React with 👍 / 👎. |
||
| fi | ||
|
|
||
| if [[ -n "${CODEX_MODEL:-}" ]]; then | ||
|
|
@@ -807,9 +807,9 @@ invoke_codex_schema() { | |
| windows_workdir=$(wslpath -w "$workdir") | ||
| windows_output=$(wslpath -w "$output_file") | ||
| windows_schema=$(wslpath -w "$schema_file") | ||
| cmd=(cmd.exe /c codex exec --full-auto --skip-git-repo-check -C "$windows_workdir") | ||
| cmd=(cmd.exe /c codex exec --approve-for-me --skip-git-repo-check -C "$windows_workdir") | ||
| else | ||
| cmd=(codex exec --full-auto --skip-git-repo-check -C "$workdir") | ||
| cmd=(codex exec --approve-for-me --skip-git-repo-check -C "$workdir") | ||
| fi | ||
|
|
||
| if [[ -n "${CODEX_MODEL:-}" ]]; then | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Publish the MCP package | ||
|
|
||
| PLAN-NEXT.md item 1 is still pending. On 2026-09-12 the public npm registry | ||
| returned 404 for `@alanshurafa/co-evolution-mcp`, `npm whoami` returned 401, | ||
| and the repository had no Actions secrets configured. Authenticate npm with | ||
| an account that can publish to the `@alanshurafa` scope before continuing. | ||
| Do not put credentials in this repository. | ||
|
|
||
| The existing tag workflow uses the repository's `NPM_TOKEN` secret. For a | ||
| manual release, run the following from `mcp/` after choosing the release | ||
| version corresponding to the source tag: | ||
|
|
||
| ```bash | ||
| npm version --no-git-tag-version <release-version> | ||
| npm pack --pack-destination ../runs/ | ||
| npm publish ../runs/alanshurafa-co-evolution-mcp-<release-version>.tgz --access public | ||
| ``` | ||
|
|
||
| `npm pack` vendors the source and compiles TypeScript through `prepack`. | ||
| The tarball is the release artifact; publishing it does not invoke the build | ||
| again. Commit the version and lockfile with a TypeScript check before tagging | ||
| the source. Choose either manual publication or the tag workflow for a release. | ||
|
|
||
| After publication, install the registry package: | ||
|
|
||
| ```bash | ||
| npm install -g @alanshurafa/co-evolution-mcp | ||
| ``` | ||
|
|
||
| Configure Claude Desktop, Cursor, or Continue using the examples in README.md, | ||
| then call `co_evolve` once on a disposable markdown document with an absolute | ||
| path and `runs_dir` pointing into this checkout's `runs/` directory. On Windows, | ||
| ensure Git for Windows' `bin` directory precedes the Windows WSL bash launcher | ||
| on the client's PATH. Record the client response and artifact directory. | ||
|
|
||
| For the current usability goal, item 1 is done when the registry install works | ||
| and `co-evolve --help` prints usage. The external MCP call above is an additional | ||
| integration exercise. A local tarball does not establish registry availability. | ||
| Run the test suite once when the item is complete; | ||
| judge execution, behavior-score gates, and extra verification loops are not | ||
| part of this release procedure. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/usr/bin/env node | ||
| import { spawn } from "node:child_process"; | ||
| import { join } from "node:path"; | ||
| import { findBash, pathForBash, VENDOR_ROOT } from "./bouncer.js"; | ||
|
|
||
| const bash = findBash(); | ||
| if (!bash) { | ||
| console.error("co-evolve requires Bash. On Windows, install Git for Windows."); | ||
| process.exit(1); | ||
| } | ||
| const child = spawn(bash, [pathForBash(join(VENDOR_ROOT, "co-evolve"), bash), ...process.argv.slice(2)], { | ||
| stdio: "inherit", | ||
| }); | ||
| child.on("error", (error) => { | ||
| console.error(`Could not start co-evolve: ${error.message}`); | ||
| process.exitCode = 1; | ||
| }); | ||
| child.on("exit", (code, signal) => { | ||
| process.exitCode = code ?? (signal === "SIGINT" ? 130 : 1); | ||
| }); | ||
| process.on("SIGINT", () => child.kill("SIGINT")); | ||
| process.on("SIGTERM", () => child.kill("SIGTERM")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user runs
co-evolve bounce doc.md --output doc.md, the wrapper forwards the path without checking it against the normalized input, and the underlying bouncer copies its final artifact overdoc.md. This violates the new command's stated input-preservation contract and can destroy the only original document; reject output paths that resolve to the input, including symlink aliases.Useful? React with 👍 / 👎.