agentlisp 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. agentlisp-2.0.0/.github/workflows/_tmp_cr41_release_buildcheck.yml +297 -0
  2. agentlisp-2.0.0/.github/workflows/_tmp_o13_patterns_mvp_verify.yml +294 -0
  3. agentlisp-2.0.0/.github/workflows/ci.yml +368 -0
  4. agentlisp-2.0.0/.github/workflows/release.yml +450 -0
  5. agentlisp-2.0.0/.gitignore +90 -0
  6. agentlisp-2.0.0/.trae/specs/no_pypi_cr41_patterns_v2_1/review.md +153 -0
  7. agentlisp-2.0.0/.trae/specs/no_pypi_cr41_patterns_v2_1/spec.md +156 -0
  8. agentlisp-2.0.0/.trae/specs/no_pypi_cr41_patterns_v2_1/tasks.md +351 -0
  9. agentlisp-2.0.0/PKG-INFO +482 -0
  10. agentlisp-2.0.0/README.md +398 -0
  11. agentlisp-2.0.0/compiler/_tmp_expand_patterns.rkt +45 -0
  12. agentlisp-2.0.0/compiler/agentlisp_compiler.rkt +714 -0
  13. agentlisp-2.0.0/compiler/checker.rkt +615 -0
  14. agentlisp-2.0.0/compiler/emitter.rkt +184 -0
  15. agentlisp-2.0.0/compiler/info.rkt +21 -0
  16. agentlisp-2.0.0/compiler/main.rkt +466 -0
  17. agentlisp-2.0.0/compiler/parser.rkt +173 -0
  18. agentlisp-2.0.0/compiler/patterns.rkt +353 -0
  19. agentlisp-2.0.0/compiler/patterns_checker_v2.rkt +204 -0
  20. agentlisp-2.0.0/compiler/patterns_v2.rkt +221 -0
  21. agentlisp-2.0.0/compiler/tests/.gitkeep +0 -0
  22. agentlisp-2.0.0/compiler/tests/test-checker-invariants.rkt +282 -0
  23. agentlisp-2.0.0/compiler/tests/test-core.rkt +66 -0
  24. agentlisp-2.0.0/compiler/tests/test_checker_ac1.rkt +266 -0
  25. agentlisp-2.0.0/compiler/tests/test_patterns_mvp.rkt +77 -0
  26. agentlisp-2.0.0/compiler/tests/test_patterns_v2_mvp.rkt +81 -0
  27. agentlisp-2.0.0/compiler/tools/check_v2_compile.rkt +29 -0
  28. agentlisp-2.0.0/config/.env.example +16 -0
  29. agentlisp-2.0.0/config/agent.example.yaml +62 -0
  30. agentlisp-2.0.0/conftest.py +155 -0
  31. agentlisp-2.0.0/docker/Dockerfile +122 -0
  32. agentlisp-2.0.0/docker/Dockerfile.dev +50 -0
  33. agentlisp-2.0.0/docker/docker-compose.yml +138 -0
  34. agentlisp-2.0.0/docker/entrypoint.sh +27 -0
  35. agentlisp-2.0.0/docs/RELEASE_CHECKLIST.md +229 -0
  36. agentlisp-2.0.0/docs/handoff/20261004_cr7_cr11_handoff.md +136 -0
  37. agentlisp-2.0.0/docs/handoff/20261005_cr26_top3_traceability_and_emit_rename_handoff.md +135 -0
  38. agentlisp-2.0.0/docs/handoff/20261005_cr27_b2_perf_job_handoff.md +135 -0
  39. agentlisp-2.0.0/docs/handoff/20261005_cr28_b3_cli_exit_handoff.md +150 -0
  40. agentlisp-2.0.0/docs/handoff/20261005_cr29_b4_fr_check2_ssot_8_handoff.md +157 -0
  41. agentlisp-2.0.0/docs/handoff/20261005_cr30_c2_traceability_matrix_align_124_handoff.md +159 -0
  42. agentlisp-2.0.0/docs/handoff/20261005_cr31_o2_traceability_auto_check_handoff.md +121 -0
  43. agentlisp-2.0.0/docs/handoff/20261005_cr32_o3_t2bench_cache_doc_handoff.md +121 -0
  44. agentlisp-2.0.0/docs/handoff/20261005_cr34_o4_ac1_rackunit_18cases_handoff.md +137 -0
  45. agentlisp-2.0.0/docs/handoff/20261006_cr36_cr37_ga_v2_0_0_rc2_and_release_optimizations_handoff.md +176 -0
  46. agentlisp-2.0.0/docs/handoff/20261006_cr38_o11_o12_pypi_trusted_publisher_and_readme_mermaid_handoff.md +198 -0
  47. agentlisp-2.0.0/docs/handoff/20261006_cr39_session_50_rounds_and_o11_o12_f841_h1_u6_o6_final_handoff.md +320 -0
  48. agentlisp-2.0.0/docs/handoff/20261006_cr40_o13_stage0_and_stage1_tdd_red_handoff.md +449 -0
  49. agentlisp-2.0.0/docs/handoff/20261008_cr41_patterns_v2_stage0_to_stage1_handoff.md +577 -0
  50. agentlisp-2.0.0/docs/spec/agentlisp-pattern-macros-tech-spec.md +456 -0
  51. agentlisp-2.0.0/docs/spec/agentlisp_specification.md +214 -0
  52. agentlisp-2.0.0/docs/spec/agentlisp_srs.md +627 -0
  53. agentlisp-2.0.0/examples/__init__.py +0 -0
  54. agentlisp-2.0.0/examples/production-repair-agent.al +125 -0
  55. agentlisp-2.0.0/examples/repair_agent.al +30 -0
  56. agentlisp-2.0.0/features/01_compiler_static_checks.feature +46 -0
  57. agentlisp-2.0.0/features/02_harness_runtime_pipeline.feature +48 -0
  58. agentlisp-2.0.0/features/03_context_memory_scoped_worker.feature +36 -0
  59. agentlisp-2.0.0/features/04_temporal_hitl_and_sandbox.feature +30 -0
  60. agentlisp-2.0.0/features/05_otel_observability_and_sse.feature +21 -0
  61. agentlisp-2.0.0/features/06_t2_bench_evaluation.feature +24 -0
  62. agentlisp-2.0.0/host/__init__.py +5 -0
  63. agentlisp-2.0.0/host/gateway.py +128 -0
  64. agentlisp-2.0.0/host/gateway_sse.py +788 -0
  65. agentlisp-2.0.0/host/sandbox.py +143 -0
  66. agentlisp-2.0.0/host/sandbox_e2b.py +173 -0
  67. agentlisp-2.0.0/host/tests/test_infra_docker_e2e.py +247 -0
  68. agentlisp-2.0.0/host/workflow.py +803 -0
  69. agentlisp-2.0.0/host/workflow_temporal.py +89 -0
  70. agentlisp-2.0.0/infra/docker-compose.infra.yml +122 -0
  71. agentlisp-2.0.0/infra/init-temporal-dbs.sh +23 -0
  72. agentlisp-2.0.0/pyproject.toml +161 -0
  73. agentlisp-2.0.0/python/agentlisp_runtime/__init__.py +29 -0
  74. agentlisp-2.0.0/python/agentlisp_runtime/cli.py +145 -0
  75. agentlisp-2.0.0/python/agentlisp_runtime/engine.py +253 -0
  76. agentlisp-2.0.0/python/agentlisp_runtime/loader.py +126 -0
  77. agentlisp-2.0.0/python/agentlisp_runtime/models.py +129 -0
  78. agentlisp-2.0.0/python/examples/run_compliance_agent.py +126 -0
  79. agentlisp-2.0.0/python/pyproject.toml +81 -0
  80. agentlisp-2.0.0/python/tests/test_runtime.py +110 -0
  81. agentlisp-2.0.0/runtime/__init__.py +29 -0
  82. agentlisp-2.0.0/runtime/base_agent_harness.py +164 -0
  83. agentlisp-2.0.0/runtime/base_harness.py +359 -0
  84. agentlisp-2.0.0/runtime/base_harness_v2.py +1379 -0
  85. agentlisp-2.0.0/runtime/checker.py +654 -0
  86. agentlisp-2.0.0/runtime/checkpoint.py +98 -0
  87. agentlisp-2.0.0/runtime/errors.py +37 -0
  88. agentlisp-2.0.0/runtime/llm_client.py +644 -0
  89. agentlisp-2.0.0/runtime/mcp_client.py +86 -0
  90. agentlisp-2.0.0/runtime/memory_fs.py +90 -0
  91. agentlisp-2.0.0/runtime/otel_tracer.py +124 -0
  92. agentlisp-2.0.0/runtime/status_bar.py +86 -0
  93. agentlisp-2.0.0/runtime/tests/test_ac1_rackunit_18cases_roundtrip.py +255 -0
  94. agentlisp-2.0.0/runtime/tests/test_cli_if_cli_1_exit_encoding.py +309 -0
  95. agentlisp-2.0.0/runtime/tests/test_harness_v2.py +2030 -0
  96. agentlisp-2.0.0/runtime/tests/test_sideeffect_builtin_tools_racket_and_python_ssot_8_items_bitwise_equal.py +132 -0
  97. agentlisp-2.0.0/runtime/tests/test_srs_acceptance.py +1369 -0
  98. agentlisp-2.0.0/runtime/tests/test_t2_bench_dataset.py +86 -0
  99. agentlisp-2.0.0/runtime/tests/test_v2_smoke.py +139 -0
  100. agentlisp-2.0.0/scheme/agent-dsl/main.rkt +135 -0
  101. agentlisp-2.0.0/scheme/agent-dsl/reader.rkt +32 -0
  102. agentlisp-2.0.0/scheme/examples/simple-agent.rkt +62 -0
  103. agentlisp-2.0.0/scheme/info.rkt +20 -0
  104. agentlisp-2.0.0/scheme/tests/test-main.rkt +63 -0
  105. agentlisp-2.0.0/scripts/_tmp_bracket_diff.py +49 -0
  106. agentlisp-2.0.0/scripts/bdd_export_traceability.py +328 -0
  107. agentlisp-2.0.0/scripts/bench/fetch_t2_dataset.py +352 -0
  108. agentlisp-2.0.0/scripts/bench/run_t2_bench.py +899 -0
  109. agentlisp-2.0.0/scripts/check_handoff_compliance.py +207 -0
  110. agentlisp-2.0.0/scripts/check_patterns_v2_ast.py +295 -0
  111. agentlisp-2.0.0/scripts/check_roadmap_traceability.py +302 -0
  112. agentlisp-2.0.0/scripts/gen_patterns_v2.py +602 -0
  113. agentlisp-2.0.0/scripts/tests/__init__.py +1 -0
  114. agentlisp-2.0.0/scripts/tests/test_traceability_export.py +101 -0
  115. agentlisp-2.0.0/scripts/tests/traceability_manifest_fallback.json +36 -0
  116. agentlisp-2.0.0/tests/_bdd_helper.py +88 -0
  117. agentlisp-2.0.0/tests/patterns/fixtures/defchain_doc_pipeline.al +3 -0
  118. agentlisp-2.0.0/tests/patterns/fixtures/defchain_doc_pipeline.expected.rkt +31 -0
  119. agentlisp-2.0.0/tests/patterns/fixtures/defparallel_multi_search.al +3 -0
  120. agentlisp-2.0.0/tests/patterns/fixtures/defparallel_multi_search.expected.rkt +38 -0
  121. agentlisp-2.0.0/tests/patterns/fixtures/defplanner_deep_researcher.al +4 -0
  122. agentlisp-2.0.0/tests/patterns/fixtures/defplanner_deep_researcher.expected.rkt +31 -0
  123. agentlisp-2.0.0/tests/patterns/fixtures/defreflect_code_refiner.al +3 -0
  124. agentlisp-2.0.0/tests/patterns/fixtures/defreflect_code_refiner.expected.rkt +28 -0
  125. agentlisp-2.0.0/tests/patterns/fixtures/defrouter_ops_gateway.al +4 -0
  126. agentlisp-2.0.0/tests/patterns/fixtures/defrouter_ops_gateway.expected.rkt +29 -0
  127. agentlisp-2.0.0/tests/patterns/fixtures/fr_pattern_02_defchain_auto_raise.al +1 -0
  128. agentlisp-2.0.0/tests/patterns/fixtures/fr_pattern_02_defparallel_auto_raise.al +1 -0
  129. agentlisp-2.0.0/tests/patterns/fixtures/fr_pattern_02_defplanner_auto_raise.al +1 -0
  130. agentlisp-2.0.0/tests/patterns/fixtures/fr_pattern_02_defreflect_auto_raise.al +1 -0
  131. agentlisp-2.0.0/tests/patterns/fixtures/fr_pattern_02_defrouter_auto_raise.al +1 -0
  132. agentlisp-2.0.0/tests/patterns/fixtures_v2/decom06_generic_GENERIC.al +5 -0
  133. agentlisp-2.0.0/tests/patterns/fixtures_v2/decom06_generic_GENERIC.expected.rkt +2 -0
  134. agentlisp-2.0.0/tests/patterns/fixtures_v2/decom06_hc_HC.al +5 -0
  135. agentlisp-2.0.0/tests/patterns/fixtures_v2/decom06_hc_HC.expected.rkt +2 -0
  136. agentlisp-2.0.0/tests/patterns/fixtures_v2/decom06_reverse_REVERSE.al +5 -0
  137. agentlisp-2.0.0/tests/patterns/fixtures_v2/decom06_reverse_REVERSE.expected.rkt +2 -0
  138. agentlisp-2.0.0/tests/patterns/fixtures_v2/decomp02_generic_GENERIC.al +4 -0
  139. agentlisp-2.0.0/tests/patterns/fixtures_v2/decomp02_generic_GENERIC.expected.rkt +2 -0
  140. agentlisp-2.0.0/tests/patterns/fixtures_v2/decomp02_hc_HC.al +4 -0
  141. agentlisp-2.0.0/tests/patterns/fixtures_v2/decomp02_hc_HC.expected.rkt +2 -0
  142. agentlisp-2.0.0/tests/patterns/fixtures_v2/decomp02_reverse_REVERSE.al +4 -0
  143. agentlisp-2.0.0/tests/patterns/fixtures_v2/decomp02_reverse_REVERSE.expected.rkt +2 -0
  144. agentlisp-2.0.0/tests/patterns/fixtures_v2/eval04_generic_GENERIC.al +5 -0
  145. agentlisp-2.0.0/tests/patterns/fixtures_v2/eval04_generic_GENERIC.expected.rkt +2 -0
  146. agentlisp-2.0.0/tests/patterns/fixtures_v2/eval04_hc_HC.al +5 -0
  147. agentlisp-2.0.0/tests/patterns/fixtures_v2/eval04_hc_HC.expected.rkt +2 -0
  148. agentlisp-2.0.0/tests/patterns/fixtures_v2/eval04_reverse_REVERSE.al +5 -0
  149. agentlisp-2.0.0/tests/patterns/fixtures_v2/eval04_reverse_REVERSE.expected.rkt +2 -0
  150. agentlisp-2.0.0/tests/patterns/fixtures_v2/exc09_generic_GENERIC.al +5 -0
  151. agentlisp-2.0.0/tests/patterns/fixtures_v2/exc09_generic_GENERIC.expected.rkt +2 -0
  152. agentlisp-2.0.0/tests/patterns/fixtures_v2/exc09_hc_HC.al +5 -0
  153. agentlisp-2.0.0/tests/patterns/fixtures_v2/exc09_hc_HC.expected.rkt +2 -0
  154. agentlisp-2.0.0/tests/patterns/fixtures_v2/exc09_reverse_REVERSE.al +5 -0
  155. agentlisp-2.0.0/tests/patterns/fixtures_v2/exc09_reverse_REVERSE.expected.rkt +2 -0
  156. agentlisp-2.0.0/tests/patterns/fixtures_v2/explore10_generic_GENERIC.al +5 -0
  157. agentlisp-2.0.0/tests/patterns/fixtures_v2/explore10_generic_GENERIC.expected.rkt +2 -0
  158. agentlisp-2.0.0/tests/patterns/fixtures_v2/explore10_hc_HC.al +5 -0
  159. agentlisp-2.0.0/tests/patterns/fixtures_v2/explore10_hc_HC.expected.rkt +2 -0
  160. agentlisp-2.0.0/tests/patterns/fixtures_v2/explore10_reverse_REVERSE.al +5 -0
  161. agentlisp-2.0.0/tests/patterns/fixtures_v2/explore10_reverse_REVERSE.expected.rkt +2 -0
  162. agentlisp-2.0.0/tests/patterns/fixtures_v2/fsm03_generic_GENERIC.al +5 -0
  163. agentlisp-2.0.0/tests/patterns/fixtures_v2/fsm03_generic_GENERIC.expected.rkt +2 -0
  164. agentlisp-2.0.0/tests/patterns/fixtures_v2/fsm03_hc_HC.al +5 -0
  165. agentlisp-2.0.0/tests/patterns/fixtures_v2/fsm03_hc_HC.expected.rkt +2 -0
  166. agentlisp-2.0.0/tests/patterns/fixtures_v2/fsm03_reverse_REVERSE.al +5 -0
  167. agentlisp-2.0.0/tests/patterns/fixtures_v2/fsm03_reverse_REVERSE.expected.rkt +2 -0
  168. agentlisp-2.0.0/tests/patterns/fixtures_v2/guard07_generic_GENERIC.al +5 -0
  169. agentlisp-2.0.0/tests/patterns/fixtures_v2/guard07_generic_GENERIC.expected.rkt +2 -0
  170. agentlisp-2.0.0/tests/patterns/fixtures_v2/guard07_hc_HC.al +5 -0
  171. agentlisp-2.0.0/tests/patterns/fixtures_v2/guard07_hc_HC.expected.rkt +2 -0
  172. agentlisp-2.0.0/tests/patterns/fixtures_v2/guard07_reverse_REVERSE.al +5 -0
  173. agentlisp-2.0.0/tests/patterns/fixtures_v2/guard07_reverse_REVERSE.expected.rkt +2 -0
  174. agentlisp-2.0.0/tests/patterns/fixtures_v2/hitl08_generic_GENERIC.al +5 -0
  175. agentlisp-2.0.0/tests/patterns/fixtures_v2/hitl08_generic_GENERIC.expected.rkt +2 -0
  176. agentlisp-2.0.0/tests/patterns/fixtures_v2/hitl08_hc_HC.al +5 -0
  177. agentlisp-2.0.0/tests/patterns/fixtures_v2/hitl08_hc_HC.expected.rkt +2 -0
  178. agentlisp-2.0.0/tests/patterns/fixtures_v2/hitl08_reverse_REVERSE.al +5 -0
  179. agentlisp-2.0.0/tests/patterns/fixtures_v2/hitl08_reverse_REVERSE.expected.rkt +2 -0
  180. agentlisp-2.0.0/tests/patterns/fixtures_v2/priority01_generic_GENERIC.al +4 -0
  181. agentlisp-2.0.0/tests/patterns/fixtures_v2/priority01_generic_GENERIC.expected.rkt +2 -0
  182. agentlisp-2.0.0/tests/patterns/fixtures_v2/priority01_hc_HC.al +4 -0
  183. agentlisp-2.0.0/tests/patterns/fixtures_v2/priority01_hc_HC.expected.rkt +2 -0
  184. agentlisp-2.0.0/tests/patterns/fixtures_v2/priority01_reverse_REVERSE.al +4 -0
  185. agentlisp-2.0.0/tests/patterns/fixtures_v2/priority01_reverse_REVERSE.expected.rkt +2 -0
  186. agentlisp-2.0.0/tests/patterns/fixtures_v2/topic05_generic_GENERIC.al +5 -0
  187. agentlisp-2.0.0/tests/patterns/fixtures_v2/topic05_generic_GENERIC.expected.rkt +2 -0
  188. agentlisp-2.0.0/tests/patterns/fixtures_v2/topic05_hc_HC.al +5 -0
  189. agentlisp-2.0.0/tests/patterns/fixtures_v2/topic05_hc_HC.expected.rkt +2 -0
  190. agentlisp-2.0.0/tests/patterns/fixtures_v2/topic05_reverse_REVERSE.al +5 -0
  191. agentlisp-2.0.0/tests/patterns/fixtures_v2/topic05_reverse_REVERSE.expected.rkt +2 -0
  192. agentlisp-2.0.0/tests/patterns/test_pattern_checker.py +157 -0
  193. agentlisp-2.0.0/tests/patterns/test_pattern_checker_v2.py +429 -0
  194. agentlisp-2.0.0/tests/patterns/test_srs_marker_independence.py +286 -0
  195. agentlisp-2.0.0/tests/step_defs/test_bdd_suite.py +1788 -0
  196. agentlisp-2.0.0/tests/test_check_roadmap_traceability.py +92 -0
  197. agentlisp-2.0.0/tests/test_compiler_end_to_end.py +74 -0
@@ -0,0 +1,297 @@
1
+ name: CR-41 RC5 BuildCheck (No Publish)
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v2.0.0-rc5-buildcheck*"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ packages: read
12
+
13
+ env:
14
+ PYTHON_VERSION: "3.12"
15
+ UV_VERSION: "0.4.0"
16
+
17
+ jobs:
18
+ build-windows:
19
+ name: Build Windows x64 Release
20
+ runs-on: windows-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: ${{ env.PYTHON_VERSION }}
28
+ architecture: x64
29
+
30
+ - name: Install uv
31
+ uses: astral-sh/setup-uv@v3
32
+ with:
33
+ version: ${{ env.UV_VERSION }}
34
+ enable-cache: false
35
+
36
+ - name: Install dependencies and build wheel + sdist
37
+ shell: pwsh
38
+ run: |
39
+ $PP = "pyproject.toml"
40
+ $ORIG = Get-Content -Raw $PP
41
+ if ($ORIG -notmatch "allow-direct-references") {
42
+ Add-Content -Path $PP -Value "`n[tool.hatch.metadata]`nallow-direct-references = true`n"
43
+ }
44
+ if (Select-String -Path $PP -Pattern "Programming Language :: Racket" -Quiet) {
45
+ (Get-Content $PP) | Where-Object { $_ -notmatch "Programming Language :: Racket" } | Set-Content $PP
46
+ }
47
+ Write-Host "--- strip Racket classifier + append allow-direct-references WORKAROUND applied (NOT committed) ---"
48
+ Get-Content $PP | Select-Object -Last 5
49
+ python -m pip install --upgrade --quiet pip build hatchling 2>&1 | Select-Object -Last 3
50
+ python -m build --wheel --sdist --no-isolation
51
+ git checkout -- pyproject.toml
52
+ Write-Host "--- dist/ 内容 ---"
53
+ Get-ChildItem dist/
54
+
55
+ - name: Package CLI exe with PyInstaller → rename with tag + platform
56
+ shell: pwsh
57
+ run: |
58
+ python -m pip install --upgrade --quiet pyinstaller==6.10.0 2>&1 | Select-Object -Last 3
59
+ python -m pip install --quiet pydantic pyyaml jsonschema structlog typer rich 2>&1 | Select-Object -Last 3
60
+ pyinstaller --onefile --name agentlisp python/agentlisp_runtime/cli.py 2>&1 | Select-Object -Last 5
61
+ $tag = "${{ github.ref_name }}"
62
+ $src = Join-Path (Get-Location) "dist\agentlisp.exe"
63
+ $dst = Join-Path (Get-Location) ("dist\agentlisp-" + $tag + "-windows-x86_64.exe")
64
+ if (Test-Path $src) {
65
+ Move-Item -Force -Path $src -Destination $dst
66
+ } else {
67
+ Write-Error "PyInstaller did not produce dist\agentlisp.exe"
68
+ exit 1
69
+ }
70
+ Write-Host "--- dist/ final ---"
71
+ Get-ChildItem dist/
72
+
73
+ - name: Upload Windows build artifacts (wheel + sdist + pyinstaller exe)
74
+ uses: actions/upload-artifact@v4
75
+ with:
76
+ name: windows-x64-release
77
+ path: |
78
+ dist/*
79
+ retention-days: 30
80
+
81
+ - name: "TR-3.4 Windows Verify: classifier strip OK + pyproject diff=0"
82
+ shell: pwsh
83
+ run: |
84
+ # 3.4a: 解压 whl 查 METADATA 不含 Programming Language :: Racket
85
+ $whl = Get-ChildItem dist/*.whl | Select-Object -First 1
86
+ Write-Host "Checking $($whl.FullName)"
87
+ python -c "import zipfile, sys; z=zipfile.ZipFile(sys.argv[1]); meta=[n for n in z.namelist() if n.endswith('METADATA')][0]; d=z.read(meta).decode(); assert 'Programming Language :: Racket' not in d, 'Racket classifier FOUND in METADATA'; print('METADATA Racket classifier: STRIPPED OK')" "$($whl.FullName)"
88
+ # 3.4b: git diff pyproject.toml 必须空
89
+ $diff = git diff -- pyproject.toml
90
+ Write-Host "git diff pyproject.toml length = $($diff.Length)"
91
+ if ($diff.Length -gt 0) { Write-Error "pyproject.toml diff NOT empty"; exit 1 }
92
+ Write-Host "pyproject.toml diff=0 (C1 禁动类合规) PASS"
93
+
94
+ build-ubuntu:
95
+ name: Build Ubuntu Release
96
+ runs-on: ubuntu-latest
97
+ steps:
98
+ - uses: actions/checkout@v4
99
+
100
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
101
+ uses: actions/setup-python@v5
102
+ with:
103
+ python-version: ${{ env.PYTHON_VERSION }}
104
+
105
+ - name: Install uv
106
+ uses: astral-sh/setup-uv@v3
107
+ with:
108
+ version: ${{ env.UV_VERSION }}
109
+ enable-cache: false
110
+
111
+ - name: Build wheels + sdist
112
+ run: |
113
+ set -euo pipefail
114
+ PP=pyproject.toml
115
+ if ! grep -q "allow-direct-references" "$PP"; then
116
+ printf '\n[tool.hatch.metadata]\nallow-direct-references = true\n' >> "$PP"
117
+ fi
118
+ if grep -q 'Programming Language :: Racket' "$PP"; then
119
+ sed -i.bak '/Programming Language :: Racket/d' "$PP" && rm -f "${PP}.bak"
120
+ fi
121
+ echo "--- strip Racket classifier + append allow-direct-references WORKAROUND applied (NOT committed) ---"
122
+ tail -n 5 "$PP"
123
+ python -m pip install --upgrade --quiet pip build hatchling 2>&1 | tail -3
124
+ python -m build --wheel --sdist --no-isolation 2>&1 | tail -20
125
+ git checkout -- pyproject.toml || true
126
+ echo "--- dist/ 内容 ---"
127
+ ls -la dist/
128
+
129
+ - name: Package CLI singlefile with PyInstaller → rename with tag + os/arch
130
+ run: |
131
+ set -euo pipefail
132
+ python -m pip install --upgrade --quiet pyinstaller==6.10.0 2>&1 | tail -3
133
+ python -m pip install --quiet pydantic pyyaml jsonschema structlog typer rich 2>&1 | tail -3
134
+ pyinstaller --onefile --name agentlisp python/agentlisp_runtime/cli.py 2>&1 | tail -5
135
+ tag="${GITHUB_REF_NAME}"
136
+ arch="$(uname -m)"
137
+ src="dist/agentlisp"
138
+ dst="dist/agentlisp-${tag}-linux-${arch}"
139
+ test -f "$src" || { echo "PyInstaller did not produce $src"; exit 1; }
140
+ mv "$src" "$dst"
141
+ echo "--- dist/ final ---"
142
+ ls -la dist/
143
+
144
+ - name: Upload build artifacts
145
+ uses: actions/upload-artifact@v4
146
+ with:
147
+ name: ubuntu-latest-release
148
+ path: dist/*
149
+ retention-days: 30
150
+
151
+ - name: "TR-3.4 Ubuntu Verify: classifier strip OK + pyproject diff=0"
152
+ run: |
153
+ set -euo pipefail
154
+ whl=$(ls dist/*.whl | head -1)
155
+ echo "Checking $whl"
156
+ python -c "import zipfile,sys; z=zipfile.ZipFile(sys.argv[1]); meta=[n for n in z.namelist() if n.endswith('METADATA')][0]; d=z.read(meta).decode(); assert 'Programming Language :: Racket' not in d, 'Racket classifier FOUND'; print('METADATA Racket classifier: STRIPPED OK')" "$whl"
157
+ diff=$(git diff -- pyproject.toml)
158
+ echo "git diff pyproject.toml length=${#diff}"
159
+ test -z "$diff" || { echo "pyproject.toml diff NOT empty"; exit 1; }
160
+ echo "pyproject.toml diff=0 (C1 禁动类合规) PASS"
161
+
162
+ build-macos:
163
+ name: Build macOS Release
164
+ runs-on: macos-latest
165
+ steps:
166
+ - uses: actions/checkout@v4
167
+
168
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
169
+ uses: actions/setup-python@v5
170
+ with:
171
+ python-version: ${{ env.PYTHON_VERSION }}
172
+
173
+ - name: Install uv
174
+ uses: astral-sh/setup-uv@v3
175
+ with:
176
+ version: ${{ env.UV_VERSION }}
177
+ enable-cache: false
178
+
179
+ - name: Build wheels + sdist
180
+ run: |
181
+ set -euo pipefail
182
+ PP=pyproject.toml
183
+ if ! grep -q "allow-direct-references" "$PP"; then
184
+ printf '\n[tool.hatch.metadata]\nallow-direct-references = true\n' >> "$PP"
185
+ fi
186
+ if grep -q 'Programming Language :: Racket' "$PP"; then
187
+ sed -i.bak '/Programming Language :: Racket/d' "$PP" && rm -f "${PP}.bak"
188
+ fi
189
+ echo "--- strip Racket classifier + append allow-direct-references WORKAROUND applied (NOT committed) ---"
190
+ tail -n 5 "$PP"
191
+ python -m pip install --upgrade --quiet pip build hatchling 2>&1 | tail -3
192
+ python -m build --wheel --sdist --no-isolation 2>&1 | tail -20
193
+ git checkout -- pyproject.toml || true
194
+ echo "--- dist/ 内容 ---"
195
+ ls -la dist/
196
+
197
+ - name: Package CLI singlefile with PyInstaller → rename with tag + os/arch
198
+ run: |
199
+ set -euo pipefail
200
+ python -m pip install --upgrade --quiet pyinstaller==6.10.0 2>&1 | tail -3
201
+ python -m pip install --quiet pydantic pyyaml jsonschema structlog typer rich 2>&1 | tail -3
202
+ pyinstaller --onefile --name agentlisp python/agentlisp_runtime/cli.py 2>&1 | tail -5
203
+ tag="${GITHUB_REF_NAME}"
204
+ arch="$(uname -m)"
205
+ src="dist/agentlisp"
206
+ dst="dist/agentlisp-${tag}-macos-${arch}"
207
+ test -f "$src" || { echo "PyInstaller did not produce $src"; exit 1; }
208
+ mv "$src" "$dst"
209
+ echo "--- dist/ final ---"
210
+ ls -la dist/
211
+
212
+ - name: Upload build artifacts
213
+ uses: actions/upload-artifact@v4
214
+ with:
215
+ name: macos-latest-release
216
+ path: dist/*
217
+ retention-days: 30
218
+
219
+ - name: "TR-3.4 macOS Verify: classifier strip OK + pyproject diff=0"
220
+ run: |
221
+ set -euo pipefail
222
+ whl=$(ls dist/*.whl | head -1)
223
+ echo "Checking $whl"
224
+ python -c "import zipfile,sys; z=zipfile.ZipFile(sys.argv[1]); meta=[n for n in z.namelist() if n.endswith('METADATA')][0]; d=z.read(meta).decode(); assert 'Programming Language :: Racket' not in d, 'Racket classifier FOUND'; print('METADATA Racket classifier: STRIPPED OK')" "$whl"
225
+ diff=$(git diff -- pyproject.toml)
226
+ echo "git diff pyproject.toml length=${#diff}"
227
+ test -z "$diff" || { echo "pyproject.toml diff NOT empty"; exit 1; }
228
+ echo "pyproject.toml diff=0 (C1 禁动类合规) PASS"
229
+
230
+ build-publish-pypi-standalone:
231
+ name: Build Publish-PyPI Standalone (NO OIDC PUBLISH)
232
+ runs-on: ubuntu-latest
233
+ steps:
234
+ - uses: actions/checkout@v4
235
+
236
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
237
+ uses: actions/setup-python@v5
238
+ with:
239
+ python-version: ${{ env.PYTHON_VERSION }}
240
+
241
+ - name: Install uv
242
+ uses: astral-sh/setup-uv@v3
243
+ with:
244
+ version: ${{ env.UV_VERSION }}
245
+ enable-cache: false
246
+
247
+ - name: Build wheel + sdist (reuse hatch allow-direct-references workaround)
248
+ run: |
249
+ set -euo pipefail
250
+ PP=pyproject.toml
251
+ if ! grep -q "allow-direct-references" "$PP"; then
252
+ printf '\n[tool.hatch.metadata]\nallow-direct-references = true\n' >> "$PP"
253
+ fi
254
+ if grep -q 'Programming Language :: Racket' "$PP"; then
255
+ sed -i.bak '/Programming Language :: Racket/d' "$PP" && rm -f "${PP}.bak"
256
+ fi
257
+ echo "--- strip Racket classifier + append allow-direct-references WORKAROUND applied (NOT committed) ---"
258
+ tail -n 5 "$PP"
259
+ python -m pip install --upgrade --quiet pip build hatchling 2>&1 | tail -3
260
+ python -m build --wheel --sdist --no-isolation 2>&1 | tail -20
261
+ git checkout -- pyproject.toml || true
262
+ echo "--- dist/ built ---"
263
+ ls -la dist/
264
+
265
+ - name: Verify PyPI package metadata (twine check --strict)
266
+ run: |
267
+ set -euo pipefail
268
+ python -m pip install --upgrade --quiet twine pkginfo 2>&1 | tail -3
269
+ echo "--- twine check ---"
270
+ python -m twine check --strict dist/*
271
+ echo "--- pkginfo inspect ---"
272
+ for f in dist/*.whl dist/*.tar.gz; do
273
+ echo ">>> $f"
274
+ pkginfo "$f" 2>&1 | grep -E "^(package_name|version|summary|license|requires_python|classifiers)" | head -20
275
+ done
276
+
277
+ - name: Upload publish-pypi standalone build artifacts
278
+ uses: actions/upload-artifact@v4
279
+ with:
280
+ name: publish-pypi-standalone-build
281
+ path: dist/*
282
+ retention-days: 30
283
+
284
+ - name: "TR-3.4 Publish-PyPI Build Verify: classifier strip + pyproject diff=0 + twine pass"
285
+ run: |
286
+ set -euo pipefail
287
+ # classifier strip 检查
288
+ whl=$(ls dist/*.whl | head -1)
289
+ echo "Checking $whl"
290
+ python -c "import zipfile,sys; z=zipfile.ZipFile(sys.argv[1]); meta=[n for n in z.namelist() if n.endswith('METADATA')][0]; d=z.read(meta).decode(); assert 'Programming Language :: Racket' not in d, 'Racket classifier FOUND'; print('METADATA Racket classifier: STRIPPED OK')" "$whl"
291
+ # pyproject diff
292
+ diff=$(git diff -- pyproject.toml)
293
+ echo "git diff pyproject.toml length=${#diff}"
294
+ test -z "$diff" || { echo "pyproject.toml diff NOT empty"; exit 1; }
295
+ echo "pyproject.toml diff=0 (C1 禁动类合规) PASS"
296
+ # 已在上一步 twine check --strict exit=0 → pass
297
+ echo "twine check --strict PASS (TR-3.4 3/3 OK)"
@@ -0,0 +1,294 @@
1
+ name: O13 Patterns MVP Standalone Verify (temp CR-40b)
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - 'patterns-mvp-rc40/**'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ verify-patterns-mvp:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 20
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Install Racket (full)
21
+ uses: Bogdanp/setup-racket@v1.11
22
+ with:
23
+ architecture: x64
24
+ distribution: full
25
+ version: "8.12"
26
+
27
+ - name: Quick syntax/load diagnostics
28
+ shell: bash -euxo pipefail {0}
29
+ run: |
30
+ echo "-- Step A: bracket diff via python --"
31
+ python3 scripts/_tmp_bracket_diff.py compiler/main.rkt 2>&1 | tee /tmp/diff_main.log || true
32
+ python3 scripts/_tmp_bracket_diff.py compiler/patterns.rkt 2>&1 | tee /tmp/diff_pat.log || true
33
+ echo "-- Step B: load patterns.rkt standalone --"
34
+ racket -e "(require (file \"$(pwd)/compiler/patterns.rkt\")) (displayln \"PATTERNS OK\")" 2>&1 | tee /tmp/pat_load.log || true
35
+ echo "-- Step C: print lines 190-260 main.rkt (cat -n) --"
36
+ awk 'NR>=190 && NR<=260 {printf "%d:\t%s\n", NR, $0}' compiler/main.rkt
37
+ echo "-- Step D: raco expand of main.rkt head lines only (up to 2048 chars) --"
38
+ racket -e "(with-input-from-file \"compiler/main.rkt\" (thunk (let loop ([n 0] [sz 0]) (define l (read-line (current-input-port) 'any)) (cond [(or (eof-object? l) (> sz 8192)) (displayln (format \"ok lines ~a sz ~a\" n sz))] [else (loop (+ n 1) (+ sz (string-length l)))])))" 2>&1 | tee /tmp/read_lines.log || true
39
+ echo "-- Step E: raco make main.rkt --"
40
+ raco make compiler/main.rkt 2>&1 | tee /tmp/raco_make.log || true
41
+
42
+ - name: Verify 5 macros standalone expand against fixtures (NO main.rkt wiring)
43
+ shell: bash -euxo pipefail {0}
44
+ run: |
45
+ cat > expand_verify.rkt <<'ENDOFRACKET'
46
+ #lang racket
47
+ (require racket/match
48
+ racket/string
49
+ racket/port
50
+ racket/function)
51
+ (require "compiler/patterns.rkt")
52
+
53
+ (define (normalize-sexp str)
54
+ (with-input-from-string str
55
+ (thunk
56
+ (let loop ([tok (read)] [out '()])
57
+ (if (eof-object? tok)
58
+ (string-trim (string-join (reverse out) " "))
59
+ (loop (read) (cons (format "~s" tok) out)))))))
60
+
61
+ (define (expand+normalize data)
62
+ (normalize-sexp (format "~s" data)))
63
+
64
+ (define (load-fixture path)
65
+ (normalize-sexp (file->string path)))
66
+
67
+ (define (same-head? actual expected nchars)
68
+ (string=? (substring actual 0 (min nchars (string-length actual)))
69
+ (substring expected 0 (min nchars (string-length expected)))))
70
+
71
+ (define *results* (make-hash))
72
+ (define (register name ok? detail)
73
+ (hash-set! *results* name (cons ok? detail)))
74
+
75
+ (define (check-macro name form expected-file n)
76
+ (with-handlers ([exn:fail? (lambda (e)
77
+ (register name #f (format "exn: ~a" (exn-message e))))])
78
+ (let* ([out (expand+normalize form)]
79
+ [exp (load-fixture expected-file)]
80
+ [head-ok? (same-head? out exp n)])
81
+ (register name head-ok?
82
+ (format "head ~a chars match=~a\n actual-head=~s\n expected-head=~s"
83
+ n head-ok?
84
+ (substring out 0 (min 300 (string-length out)))
85
+ (substring exp 0 (min 300 (string-length exp))))))))
86
+
87
+ (check-macro 'defreflect
88
+ (defreflect-agent code-refiner
89
+ :provider "anthropic" :model-name "claude-3-7-sonnet"
90
+ :tools (bash pytest) :critic "检查代码逻辑漏洞" :max-retries 3)
91
+ "tests/patterns/fixtures/defreflect_code_refiner.expected.rkt"
92
+ 200)
93
+
94
+ (check-macro 'defrouter
95
+ (defrouter-agent ops-gateway
96
+ :model ("openai" "gpt-5.6")
97
+ :routes ((:intent 'db-query => db-worker)
98
+ (:intent 'net-debug => net-worker)))
99
+ "tests/patterns/fixtures/defrouter_ops_gateway.expected.rkt"
100
+ 200)
101
+
102
+ (check-macro 'defchain
103
+ (defchain-agent doc-pipeline
104
+ :steps ((:prompt "提取文档摘要" :out summary)
105
+ (:prompt "基于摘要生成代码" :in summary :out code)))
106
+ "tests/patterns/fixtures/defchain_doc_pipeline.expected.rkt"
107
+ 200)
108
+
109
+ (check-macro 'defparallel
110
+ (defparallel-agent multi-search
111
+ :branches ((search-a "来源 A") (search-b "来源 B"))
112
+ :reducer aggregator-agent)
113
+ "tests/patterns/fixtures/defparallel_multi_search.expected.rkt"
114
+ 200)
115
+
116
+ (check-macro 'defplanner
117
+ (defplanner-agent deep-researcher
118
+ :model ("anthropic" "claude-3-7-sonnet")
119
+ :planner-prompt "将研究目标分解为 3-5 个步骤"
120
+ :executor-tools (web-search read-pdf))
121
+ "tests/patterns/fixtures/defplanner_deep_researcher.expected.rkt"
122
+ 200)
123
+
124
+ (call-with-output-file "/tmp/patterns_verify.json"
125
+ (lambda (out)
126
+ (for/list ([(k v) (in-hash *results*)])
127
+ (displayln (format "RESULT name=~a ok=~a detail=~a" k (car v) (cdr v)) out)))
128
+ #:exists 'replace)
129
+ (for/list ([(k v) (in-hash *results*)])
130
+ (displayln (format "RESULT name=~a ok=~a" k (car v))))
131
+ (define failures (for/sum ([(k v) (in-hash *results*)] #:when (not (car v))) 1))
132
+ (printf "SUMMARY failures=~a/5\n" failures)
133
+ (flush-output)
134
+ (exit failures)
135
+ ENDOFRACKET
136
+ ls -la expand_verify.rkt
137
+ racket expand_verify.rkt 2>&1 | tee /tmp/expand_stdout.log
138
+ echo "--- expand LOG TAIL ---"
139
+ tail -20 /tmp/expand_stdout.log || true
140
+
141
+ # CR-42 F1(AC-1①):V2 standalone 闸门 —— 10 宏 × (HC, GENERIC) = 20 分支,
142
+ # 直接 require compiler/patterns_v2.rkt 逐分支展开(不依赖 main.rkt 接线),
143
+ # 每分支断言 顶层 (define-agent ...) 形状 + 与 .expected.rkt 前 200 字节全等,
144
+ # 末尾必须打印 SUMMARY failures=0/20 且 exit 0。
145
+ - name: Verify 10 V2 macros standalone expand against fixtures (10 macros x HC/GENERIC = 20 branches, NO main.rkt wiring)
146
+ shell: bash -euxo pipefail {0}
147
+ run: |
148
+ cat > expand_verify_v2.rkt <<'ENDOFRACKET'
149
+ #lang racket
150
+ (require racket/file
151
+ racket/list
152
+ racket/path
153
+ racket/string
154
+ racket/port)
155
+
156
+ (require "compiler/patterns_v2.rkt")
157
+
158
+ (define (normalize-sexp str)
159
+ (with-input-from-string str
160
+ (thunk
161
+ (let loop ([tok (read)] [out '()])
162
+ (if (eof-object? tok)
163
+ (string-trim (string-join (reverse out) " "))
164
+ (loop (read) (cons (format "~s" tok) out)))))))
165
+
166
+ (define (load-fixture path) (normalize-sexp (file->string path)))
167
+
168
+ (define (same-head? actual expected nchars)
169
+ (string=? (substring actual 0 (min nchars (string-length actual)))
170
+ (substring expected 0 (min nchars (string-length expected)))))
171
+
172
+ (define *results* (make-hash))
173
+ (define (register name ok? detail) (hash-set! *results* name (cons ok? detail)))
174
+
175
+ (define (v2-branch-files)
176
+ (sort
177
+ (for/list ([f (in-directory "tests/patterns/fixtures_v2")]
178
+ #:when (and (file-exists? f)
179
+ (regexp-match? #rx"_(hc_HC|generic_GENERIC)\\.al$" (path->string f))))
180
+ (path->string f))
181
+ string<?))
182
+
183
+ (define ns (variable-reference->namespace (#%variable-reference)))
184
+
185
+ (define (check-branch al-file)
186
+ (define name (path->string (file-name-from-path al-file)))
187
+ (define expected-file (path-replace-extension al-file #".expected.rkt"))
188
+ (with-handlers ([exn:fail? (lambda (e) (register name #f (format "exn: ~a" (exn-message e))))])
189
+ (define form (with-input-from-file al-file read))
190
+ (define expanded (eval form ns))
191
+ (define out (normalize-sexp (format "~s" expanded)))
192
+ (define exp (load-fixture expected-file))
193
+ (define shape-ok? (and (pair? expanded) (memq (car expanded) '(define-agent defagent))))
194
+ (define head-ok? (same-head? out exp 200))
195
+ (register name (and shape-ok? head-ok?)
196
+ (format "shape=~a head200=~a head=~s" shape-ok? head-ok?
197
+ (substring out 0 (min 120 (string-length out)))))))
198
+
199
+ (for-each check-branch (v2-branch-files))
200
+
201
+ (for ([(k v) (in-hash *results*)])
202
+ (displayln (format "RESULT name=~a ok=~a detail=~a" k (car v) (cdr v))))
203
+ (define failures (for/sum ([(k v) (in-hash *results*)] #:when (not (car v))) 1))
204
+ (printf "SUMMARY failures=~a/20 (V2 10 macros x HC/GENERIC)~n" failures)
205
+ (flush-output)
206
+ (exit failures)
207
+ ENDOFRACKET
208
+ ls -la expand_verify_v2.rkt
209
+ racket expand_verify_v2.rkt 2>&1 | tee /tmp/expand_v2_stdout.log
210
+ echo "--- V2 expand LOG TAIL ---"
211
+ tail -25 /tmp/expand_v2_stdout.log || true
212
+
213
+ - name: Setup Python (for pytest patterns cases)
214
+ uses: actions/setup-python@v5
215
+ with:
216
+ python-version: "3.12"
217
+
218
+ - name: Install Python deps
219
+ shell: bash -euxo pipefail {0}
220
+ run: |
221
+ python3 -m pip install --upgrade pip
222
+ python3 -m pip install pytest pytest-bdd ruff pytest-cov
223
+ python3 -m pip install -e . 2>&1 | tail -3 || true
224
+
225
+ - name: Run pytest patterns cases
226
+ shell: bash -euxo pipefail {0}
227
+ run: |
228
+ export PYTHONPATH=$(pwd):$(pwd)/tests
229
+ which racket && racket --version
230
+ echo "-- Sanity dump-ast defreflect 300 chars --"
231
+ racket compiler/main.rkt --dump-ast tests/patterns/fixtures/defreflect_code_refiner.al > /tmp/sanity_ast.txt 2>&1 || echo "SANITY racket exit=$? (non-fatal)"
232
+ head -c 300 /tmp/sanity_ast.txt
233
+ echo
234
+ echo "-- V2 AST gate: Core AST 合法性(镜像 parser 白名单/枚举,无需 Racket)--"
235
+ python3 scripts/check_patterns_v2_ast.py
236
+ echo
237
+ echo "-- Now full pytest patterns suite (V1 5 + V2 10 + NFR01/02 15+15=30 parametrize, 约 10+30+15+15=70 patterns pytest cases) --"
238
+ python3 -m pytest tests/patterns/test_pattern_checker.py tests/patterns/test_pattern_checker_v2.py tests/patterns/test_srs_marker_independence.py -v 2>&1 | tee /tmp/pytest_patterns.log
239
+ echo "===== pytest patterns summary tail 20 ====="
240
+ tail -20 /tmp/pytest_patterns.log
241
+
242
+ - name: Run RackUnit patterns MVP (V1 5/5 + V2 10/10 合计 15 RackUnit 全绿)
243
+ shell: bash -euxo pipefail {0}
244
+ run: |
245
+ cd compiler/tests
246
+ raco test test_patterns_mvp.rkt 2>&1 | tee /tmp/rackunit_patterns.log
247
+ echo "===== RackUnit V1 patterns summary tail 10 ====="
248
+ tail -10 /tmp/rackunit_patterns.log
249
+ raco test test_patterns_v2_mvp.rkt 2>&1 | tee /tmp/rackunit_v2_patterns.log
250
+ echo "===== RackUnit V2 patterns summary tail 10 ====="
251
+ tail -10 /tmp/rackunit_v2_patterns.log
252
+
253
+ # 报告型闸门(continue-on-error):本步骤暴露的是 **C1 冻结文件内的既存缺陷**,与 CR-41 模式层无关:
254
+ # ① compiler/agentlisp_compiler.rkt 括号不平衡(par=-2:L119 / L692 各多一个 ")")→ 文件无法被 Racket 读取
255
+ # ② compiler/checker.rkt:102 (struct srcloc* … #:transparent #:prefab) → 8.12 报 multiple inspector specs(即 GAP-1)
256
+ # ③ compiler/parser.rkt:54 (al-agent name purpose tools workflows hooks) 5 参 vs 6 字段 → CLI 编译路径对任何 .al 都 arity mismatch
257
+ # 修 ①②③ 需改 C1 禁动类(AC-6 diff≠0)→ 待 Owner 批准,故本步骤只报告不阻塞。
258
+ - name: V2 end-to-end compile probe (报告型:C1-blocked,非阻塞)
259
+ continue-on-error: true
260
+ shell: bash -euxo pipefail {0}
261
+ run: |
262
+ ok=0; fail=0
263
+ for f in tests/patterns/fixtures_v2/*.al; do
264
+ if racket compiler/main.rkt -i "$f" -o /tmp/v2out.py > /tmp/v2compile.log 2>&1; then
265
+ ok=$((ok+1))
266
+ else
267
+ fail=$((fail+1)); echo "COMPILE FAIL: $f"; tail -15 /tmp/v2compile.log
268
+ fi
269
+ done
270
+ echo "V2-COMPILE ok=$ok fail=$fail (C1-blocked,非阻塞)"
271
+ echo "== 正规通路探测 compile-agent-lisp(旁路 legacy parser.rkt)=="
272
+ racket compiler/tools/check_v2_compile.rkt 2>&1 | tail -12 || true
273
+ echo "-- V1 已知缺陷登记(CR-42 阻断项,本 Job 不阻塞)--"
274
+ v1ok=0; v1fail=0
275
+ for f in tests/patterns/fixtures/defreflect_code_refiner.al tests/patterns/fixtures/defrouter_ops_gateway.al tests/patterns/fixtures/defchain_doc_pipeline.al tests/patterns/fixtures/defparallel_multi_search.al tests/patterns/fixtures/defplanner_deep_researcher.al; do
276
+ if racket compiler/main.rkt -i "$f" -o /tmp/v1out.py > /tmp/v1compile.log 2>&1; then v1ok=$((v1ok+1)); else v1fail=$((v1fail+1)); echo "V1-COMPILE FAIL: $f"; tail -5 /tmp/v1compile.log; fi
277
+ done
278
+ echo "V1-COMPILE ok=$v1ok fail=$v1fail (CR-42 已知:V1 宏产物含非白名单 harness 键)"
279
+ echo "C1-BLOCKED: agentlisp_compiler par=-2 / checker.rkt srcloc* / parser.rkt al-agent arity 5v6(待 Owner 批准修复)"
280
+
281
+ - name: Upload verification log
282
+ if: always()
283
+ uses: actions/upload-artifact@v4
284
+ with:
285
+ name: patterns-verify-result
286
+ path: |
287
+ /tmp/patterns_verify.json
288
+ /tmp/diff_*.log
289
+ /tmp/pat_load.log
290
+ /tmp/read_lines.log
291
+ /tmp/raco_make.log
292
+ /tmp/pytest_patterns.log
293
+ /tmp/rackunit_patterns.log
294
+ /tmp/rackunit_v2_patterns.log