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
1 change: 0 additions & 1 deletion .gf/tests/gfcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ gf test .gf/tests/gfcode

```bash
gf test review/tests/gfcode
gf test simplify/tests/gfcode
gf test web-search/tests/gfcode
```
179 changes: 88 additions & 91 deletions .github/workflows/check-debian.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,88 @@
name: Check on Debian trixie

# 静态检查 CI:只跑格式化检查(gf fmt --check)与代码度量检查(gf check),
# 不执行测试(测试在 test-debian.yml 中独立运行)。
# 与 liii 固定 GOLDFISH_VERSION 不同,这里通过 releases/latest API 取最新 tag,
# 始终用最新发布的 Goldfish(参考 liii/cd-debian13.yml 的取最新版做法)。

on:
workflow_dispatch:
push:
branches: [main]
paths:
- '.gf/gfcode/**'
- '.gf/tests/**'
- 'ai/**'
- 'agent/**'
- 'code/**'
- 'review/**'
- 'simplify/**'
- 'tests/**'
- 'app/**'
- 'web-search/**'
- 'gfproject.json'
- 'gf_check.json'
- 'gf_fmt.json'
- '.github/workflows/check-debian.yml'
pull_request:
paths:
- '.gf/gfcode/**'
- '.gf/tests/**'
- 'ai/**'
- 'agent/**'
- 'code/**'
- 'review/**'
- 'simplify/**'
- 'tests/**'
- 'app/**'
- 'web-search/**'
- 'gfproject.json'
- 'gf_check.json'
- 'gf_fmt.json'
- '.github/workflows/check-debian.yml'

env:
DEBIAN_FRONTEND: noninteractive

jobs:
check:
container: debian:trixie
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y git curl ca-certificates python3

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: git add safe directory
run: git config --global --add safe.directory '*'

- name: Install Goldfish (latest)
run: |
TAG=$(curl -fsSL -H "User-Agent: gfcode-ci" \
-H "Authorization: Bearer ${{ github.token }}" \
https://api.github.com/repos/MoganLab/goldfish/releases/latest \
| python3 -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")
echo "Latest goldfish release: $TAG"
curl -fsSL -o /tmp/goldfish.deb \
"https://github.com/MoganLab/goldfish/releases/download/$TAG/goldfish-scheme-x86_64-$TAG.deb"
apt-get install -y /tmp/goldfish.deb
gf version

- name: Format Check
run: |
gf fmt --check ai
gf fmt --check agent
gf fmt --check code
gf fmt --check .gf/gfcode
gf fmt --check .gf/tests
gf fmt --check review
gf fmt --check simplify
gf fmt --check app
gf fmt --check web-search
gf fmt --check tests

- name: Run code metrics check
run: gf check
name: Check on Debian trixie

# 静态检查 CI:只跑格式化检查(gf fmt --check)与代码度量检查(gf check),
# 不执行测试(测试在 test-debian.yml 中独立运行)。
# 与 liii 固定 GOLDFISH_VERSION 不同,这里通过 releases/latest API 取最新 tag,
# 始终用最新发布的 Goldfish(参考 liii/cd-debian13.yml 的取最新版做法)。

on:
workflow_dispatch:
push:
branches: [main]
paths:
- '.gf/gfcode/**'
- '.gf/tests/**'
- 'ai/**'
- 'agent/**'
- 'code/**'
- 'review/**'
- 'tests/**'
- 'app/**'
- 'web-search/**'
- 'gfproject.json'
- 'gf_check.json'
- 'gf_fmt.json'
- '.github/workflows/check-debian.yml'
pull_request:
paths:
- '.gf/gfcode/**'
- '.gf/tests/**'
- 'ai/**'
- 'agent/**'
- 'code/**'
- 'review/**'
- 'tests/**'
- 'app/**'
- 'web-search/**'
- 'gfproject.json'
- 'gf_check.json'
- 'gf_fmt.json'
- '.github/workflows/check-debian.yml'

env:
DEBIAN_FRONTEND: noninteractive

jobs:
check:
container: debian:trixie
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y git curl ca-certificates python3

- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: git add safe directory
run: git config --global --add safe.directory '*'

- name: Install Goldfish (latest)
run: |
TAG=$(curl -fsSL -H "User-Agent: gfcode-ci" \
-H "Authorization: Bearer ${{ github.token }}" \
https://api.github.com/repos/MoganLab/goldfish/releases/latest \
| python3 -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")
echo "Latest goldfish release: $TAG"
curl -fsSL -o /tmp/goldfish.deb \
"https://github.com/MoganLab/goldfish/releases/download/$TAG/goldfish-scheme-x86_64-$TAG.deb"
apt-get install -y /tmp/goldfish.deb
gf version

- name: Format Check
run: |
gf fmt --check ai
gf fmt --check agent
gf fmt --check code
gf fmt --check .gf/gfcode
gf fmt --check .gf/tests
gf fmt --check review
gf fmt --check app
gf fmt --check web-search
gf fmt --check tests

- name: Run code metrics check
run: gf check
9 changes: 0 additions & 9 deletions .github/workflows/test-plugins-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ on:
- 'agent/**'
- 'code/**'
- 'review/**'
- 'simplify/**'
- 'tests/**'
- 'web-search/**'
- 'gfproject.json'
Expand All @@ -27,7 +26,6 @@ on:
- 'agent/**'
- 'code/**'
- 'review/**'
- 'simplify/**'
- 'tests/**'
- 'web-search/**'
- 'gfproject.json'
Expand Down Expand Up @@ -71,15 +69,8 @@ jobs:

- name: Test review plugin
run: |
gf test review/tests/liii
gf test review/tests/gfcode

- name: Test simplify plugin
run: |
gf test simplify/tests/liii
gf test simplify/tests/gfcode

- name: Test web-search plugin
run: |
gf test web-search/tests/liii
gf test web-search/tests/gfcode
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__pycache__
# local test-run logs captured from stdout (e.g. oauth-test-output.txt)
*-test-output.txt

# generated library doc index
function-library-index.json
6 changes: 2 additions & 4 deletions app/liii/pi/app/cli/help.scm
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@
" (overrides PI_CODING_AGENT_SESSION_DIR\n"
" and sessionDir in settings.json)\n"
" --code-review Review uncommitted changes and print a report\n"
" --simplify Review uncommitted changes for simplification (read-only)\n"
" --apply With --simplify, apply within-range changes\n"
" --staged With --code-review/--simplify, review only staged changes\n"
" --ref <ref> With --code-review/--simplify, diff against the given ref\n"
" --staged With --code-review, review only staged changes\n"
" --ref <ref> With --code-review, diff against the given ref\n"
" --auto-review Inject a per-language review checklist after write/edit\n"
" --system-prompt <text> Override system prompt\n"
" --append-system-prompt <text>\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
;; 视具体调用结果而定。

(set! *load-path*
(append (list "../review" "../simplify" "../web-search" "review" "simplify"
"web-search" "../.gf" ".gf"
) ;list
(append (list "../review" "../web-search" "review" "web-search" "../.gf" ".gf")
*load-path*
) ;append
) ;set!
Expand Down
39 changes: 34 additions & 5 deletions code/liii/pi/code/core/extensions/discovery.scm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
(begin

;; 源码树内的扩展候选目录:除 .gf/gfcode 外,各 domain 根下的
;; gfcode/ 目录(如 review/gfcode、simplify/gfcode、web-search/gfcode)
;; gfcode/ 目录(如 review/gfcode、web-search/gfcode)
;; 也参与内置发现;同一 gfcode 目录只收录一次。
(define (%source-tree-extension-candidates)
(let loop
Expand Down Expand Up @@ -109,6 +109,17 @@
) ;let
) ;define

;; 多文件扩展包:gfcode/<dir>/ 下存在 index.scm 时,只有 index.scm
;; 是扩展入口(导出 extension 工厂),同目录其余 .scm 为内部子库,
;; 不作为独立扩展加载。
(define (%package-index-path? root path-str)
(let* ((p (path path-str)) (dir (path-parent p)))
(and (string=? (path-name p) "index.scm")
(not (string=? (%normalize-path dir) (%normalize-path root)))
) ;and
) ;let*
) ;define

(define (%valid-library-file? name)
(and (not (string-null? name))
(not (char=? (string-ref name 0) #\.))
Expand Down Expand Up @@ -158,10 +169,28 @@
(define (pi-scan-extension-dir dir)
(let ((root (%normalize-path dir)))
(if (and (path-exists? (path root)) (path-dir? (path root)))
(map
(lambda (p) (%library-entry (path-parent (path root)) p))
(%scan-library-tree root "")
) ;map
(let* ((files (%scan-library-tree root ""))
(package-dirs
(map
(lambda (p) (%normalize-path (path-parent (path p))))
(filter (lambda (p) (%package-index-path? root p)) files)
) ;map
) ;package-dirs
) ;
(map
(lambda (p) (%library-entry (path-parent (path root)) p))
(filter
(lambda (p)
(or (%package-index-path? root p)
(not
(member (%normalize-path (path-parent (path p))) package-dirs)
) ;not
) ;or
) ;lambda
files
) ;filter
) ;map
) ;let*
'()
) ;if
) ;let
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
;; 解析后的参数字典。

(set! *load-path*
(append (list "../review" "../simplify" "../web-search" "review" "simplify"
"web-search"
) ;list
*load-path*
) ;append
(append (list "../review" "../web-search" "review" "web-search") *load-path*)
) ;set!

(import (liii check) (liii pi code cli args))
Expand Down
61 changes: 0 additions & 61 deletions code/tests/liii/pi/code/cli/args/parse-pi-args-simplify-test.scm

This file was deleted.

Loading
Loading