Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ codex-fable5 findings gate
| コマンド | 目的 |
| --- | --- |
| `codex-fable5 status` | findings と goal の進捗を表示します。 |
| `codex-fable5 version` | インストール済み plugin version、パス、git checkout 状態を表示します。 |
| `codex-fable5 update` | FableCodex checkout/plugin package を最新の安定版 `v*` tag に更新します。 |
| `codex-fable5 goals create` | ローカルの multi-step goal ledger を作成します。 |
| `codex-fable5 goals next` | 次の goal を開始または再開します。 |
| `codex-fable5 goals checkpoint` | evidence 付きで goal を complete、failed、blocked にします。 |
Expand All @@ -210,6 +212,8 @@ codex-fable5 findings gate
plugins/codex-fable5/bin/codex-fable5 status
```

`codex-fable5 update` が変更するのは FableCodex checkout/plugin package だけです。model access、provider credential、hidden runtime behavior は変更しません。最新の安定版ではなく開発 branch を意図的に使う場合だけ、`codex-fable5 update --ref main` を使用してください。

## インストール方法

安定版:
Expand Down
4 changes: 4 additions & 0 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ codex-fable5 findings gate
| 명령어 | 용도 |
| --- | --- |
| `codex-fable5 status` | findings와 goal 진행 상태를 봅니다. |
| `codex-fable5 version` | 설치된 plugin version, 경로, git checkout 상태를 봅니다. |
| `codex-fable5 update` | FableCodex checkout/plugin package를 최신 안정 `v*` tag로 업데이트합니다. |
| `codex-fable5 goals create` | 로컬 multi-step goal ledger를 만듭니다. |
| `codex-fable5 goals next` | 다음 goal을 시작하거나 재개합니다. |
| `codex-fable5 goals checkpoint` | goal을 evidence와 함께 complete, failed, blocked로 표시합니다. |
Expand All @@ -210,6 +212,8 @@ codex-fable5 findings gate
plugins/codex-fable5/bin/codex-fable5 status
```

`codex-fable5 update`는 FableCodex checkout/plugin package만 변경합니다. model access, provider credential, hidden runtime behavior는 바꾸지 않습니다. 최신 안정 release가 아니라 개발 branch를 의도적으로 쓰려면 `codex-fable5 update --ref main`을 사용하세요.

## 설치 옵션

안정 버전:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ The gate fails while `open` or `blocked` findings remain. Final goal completion
| Command | Purpose |
| --- | --- |
| `codex-fable5 status` | Show findings and goal progress. |
| `codex-fable5 version` | Show the installed plugin version, paths, and git checkout state. |
| `codex-fable5 update` | Update the FableCodex checkout/plugin package to the latest stable `v*` tag. |
| `codex-fable5 goals create` | Create a local multi-step goal ledger. |
| `codex-fable5 goals next` | Start or resume the next goal. |
| `codex-fable5 goals checkpoint` | Mark a goal complete, failed, or blocked with evidence. |
Expand All @@ -210,6 +212,8 @@ Without changing `PATH`, run the checkout helper directly:
plugins/codex-fable5/bin/codex-fable5 status
```

`codex-fable5 update` changes only the FableCodex checkout/plugin package. It does not change model access, provider credentials, or hidden runtime behavior. Use `codex-fable5 update --ref main` only when you intentionally want the development branch instead of the latest stable release.

## Install Options

Stable release:
Expand Down
4 changes: 4 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ codex-fable5 findings gate
| 命令 | 用途 |
| --- | --- |
| `codex-fable5 status` | 查看 findings 和 goal 进度。 |
| `codex-fable5 version` | 显示已安装的 plugin version、路径和 git checkout 状态。 |
| `codex-fable5 update` | 将 FableCodex checkout/plugin package 更新到最新稳定 `v*` tag。 |
| `codex-fable5 goals create` | 创建本地 multi-step goal ledger。 |
| `codex-fable5 goals next` | 开始或继续下一个 goal。 |
| `codex-fable5 goals checkpoint` | 带 evidence 将 goal 标记为 complete、failed 或 blocked。 |
Expand All @@ -210,6 +212,8 @@ codex-fable5 findings gate
plugins/codex-fable5/bin/codex-fable5 status
```

`codex-fable5 update` 只会更改 FableCodex checkout/plugin package。它不会更改 model access、provider credential 或 hidden runtime behavior。只有在你明确想使用开发 branch 而不是最新稳定版时,才使用 `codex-fable5 update --ref main`。

## 安装选项

稳定版:
Expand Down
4 changes: 4 additions & 0 deletions README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ codex-fable5 findings gate
| 指令 | 用途 |
| --- | --- |
| `codex-fable5 status` | 查看 findings 和 goal 進度。 |
| `codex-fable5 version` | 顯示已安裝的 plugin version、路徑和 git checkout 狀態。 |
| `codex-fable5 update` | 將 FableCodex checkout/plugin package 更新到最新穩定 `v*` tag。 |
| `codex-fable5 goals create` | 建立本地 multi-step goal ledger。 |
| `codex-fable5 goals next` | 開始或繼續下一個 goal。 |
| `codex-fable5 goals checkpoint` | 帶 evidence 將 goal 標記為 complete、failed 或 blocked。 |
Expand All @@ -210,6 +212,8 @@ codex-fable5 findings gate
plugins/codex-fable5/bin/codex-fable5 status
```

`codex-fable5 update` 只會變更 FableCodex checkout/plugin package。它不會變更 model access、provider credential 或 hidden runtime behavior。只有在你明確想使用開發 branch 而不是最新穩定版時,才使用 `codex-fable5 update --ref main`。

## 安裝選項

穩定版:
Expand Down
139 changes: 139 additions & 0 deletions plugins/codex-fable5/bin/codex-fable5
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,156 @@
set -eu

SCRIPT_DIR=$(CDPATH= cd "$(dirname "$0")" && pwd)
PLUGIN_ROOT=$(CDPATH= cd "$SCRIPT_DIR/.." && pwd)
REPO_ROOT=$(CDPATH= cd "$PLUGIN_ROOT/../.." && pwd)
MANIFEST="$PLUGIN_ROOT/.codex-plugin/plugin.json"
GOALS="$SCRIPT_DIR/../skills/codex-fable5/scripts/codex_goals.py"
FINDINGS="$SCRIPT_DIR/../skills/codex-fable5/scripts/codex_findings.py"
SKILL_ROOT=$(CDPATH= cd "$SCRIPT_DIR/../skills/codex-fable5" && pwd)
SKILL="$SKILL_ROOT/SKILL.md"

usage() {
cat <<'EOF'
Usage:
codex-fable5 status
codex-fable5 version
codex-fable5 update [--ref <ref>] [--no-fetch]
codex-fable5 goals <command> [args...]
codex-fable5 findings <command> [args...]

Examples:
codex-fable5 status
codex-fable5 version
codex-fable5 update
codex-fable5 update --ref main
codex-fable5 findings add --title "Missing verification" --evidence "No test evidence"
codex-fable5 findings gate
codex-fable5 goals next
EOF
}

manifest_value() {
key=$1
python3 - "$MANIFEST" "$key" <<'PY'
import json
import sys
path, key = sys.argv[1:]
try:
data = json.loads(open(path, encoding="utf-8").read())
except OSError as exc:
raise SystemExit(f"codex-fable5: could not read manifest: {exc}")
value = data.get(key, "")
print(value if isinstance(value, str) else "")
PY
}

cmd_version() {
name=$(manifest_value name)
version=$(manifest_value version)
printf '%s %s\n' "$name" "$version"
printf 'plugin: %s\n' "$PLUGIN_ROOT"
printf 'skill: %s\n' "$SKILL"
printf 'wrapper: %s\n' "$0"
if git -C "$REPO_ROOT" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
branch=$(git -C "$REPO_ROOT" rev-parse --abbrev-ref HEAD 2>/dev/null || printf 'unknown')
commit=$(git -C "$REPO_ROOT" rev-parse --short HEAD 2>/dev/null || printf 'unknown')
if [ -n "$(git -C "$REPO_ROOT" status --porcelain 2>/dev/null || true)" ]; then
state=dirty
else
state=clean
fi
printf 'git: %s %s %s\n' "$branch" "$commit" "$state"
fi
}

latest_stable_tag() {
git -C "$REPO_ROOT" tag --list 'v[0-9]*' --sort=-v:refname | grep -E '^v[0-9]+(\.[0-9]+)*$' | sed -n '1p'
}

cmd_update() {
ref=""
fetch=1
while [ "$#" -gt 0 ]; do
case "$1" in
--ref)
shift
if [ "$#" -eq 0 ]; then
printf '%s\n' "codex-fable5: --ref requires a value" >&2
exit 2
fi
ref=$1
;;
--no-fetch)
fetch=0
;;
-h|--help|help)
printf '%s\n' "Usage: codex-fable5 update [--ref <ref>] [--no-fetch]"
printf '%s\n' "Default updates the FableCodex checkout/plugin package to the latest stable v* tag."
return 0
;;
*)
printf '%s\n' "codex-fable5: unknown update option '$1'" >&2
exit 2
;;
esac
shift
done

current=$(manifest_value version)
printf 'codex-fable5: current version %s\n' "$current"
printf '%s\n' "codex-fable5: updates the FableCodex checkout/plugin package only; it does not change model/provider access."

if ! git -C "$REPO_ROOT" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
target=${ref:-'<latest-stable-tag>'}
printf '%s\n' "codex-fable5: this installation is not inside a git checkout; update with Codex plugin commands:"
printf ' codex plugin marketplace add baskduf/FableCodex --ref %s\n' "$target"
printf '%s\n' " codex plugin add codex-fable5@fablecodex"
printf '%s\n' "codex-fable5: restart Codex after updating."
return 0
fi

if [ -n "$(git -C "$REPO_ROOT" status --porcelain)" ]; then
printf '%s\n' "codex-fable5: refusing to update a dirty checkout. Commit, stash, or clean local changes first." >&2
exit 1
fi

if [ "$fetch" -eq 1 ]; then
git -C "$REPO_ROOT" fetch --tags --prune --quiet
fi

if [ -z "$ref" ]; then
ref=$(latest_stable_tag)
if [ -z "$ref" ]; then
printf '%s\n' "codex-fable5: no stable v* tags found." >&2
exit 1
fi
fi

if [ "$ref" = "main" ]; then
current_ref=$(git -C "$REPO_ROOT" rev-parse --abbrev-ref HEAD)
if [ "$current_ref" != "main" ]; then
git -C "$REPO_ROOT" checkout main
fi
git -C "$REPO_ROOT" pull --ff-only
printf '%s\n' "codex-fable5: updated to main."
else
if ! git -C "$REPO_ROOT" rev-parse --verify --quiet "$ref^{commit}" >/dev/null; then
printf 'codex-fable5: ref not found: %s\n' "$ref" >&2
exit 1
fi
current_commit=$(git -C "$REPO_ROOT" rev-parse HEAD)
target_commit=$(git -C "$REPO_ROOT" rev-parse "$ref^{commit}")
if [ "$current_commit" = "$target_commit" ]; then
printf 'codex-fable5: already up to date at %s\n' "$ref"
else
git -C "$REPO_ROOT" checkout "$ref"
printf 'codex-fable5: updated to %s\n' "$ref"
fi
fi

printf '%s\n' "codex-fable5: restart Codex to reload the plugin."
}

if [ "$#" -eq 0 ]; then
usage
exit 0
Expand All @@ -37,6 +169,13 @@ case "$1" in
printf '%s\n' "codex-fable5: no goal plan"
fi
;;
version|--version|-v)
cmd_version
;;
update)
shift
cmd_update "$@"
;;
findings|finding|f)
shift
exec python3 "$FINDINGS" "$@"
Expand Down
Loading