9 Commits

Author SHA1 Message Date
agent.develop
bc4aaa2463 fix(pbls): [deploy-Q4] build.sh gate 6.4 strip comments/COMMENT strings before scanning + table count 36 to 37
Defect (deploy_test round 3, Q4 / deploy-evidence E15):
1. Gate 6.4 grepped the raw DDL for dialect keywords and was killed by 3 false positives
   that are pure documentation text: L6 header line comment, L220 business word
   "references" inside a COMMENT string, L891 contract self-check block that literally
   lists FOREIGN KEY / REFERENCES / ENUM( / SERIAL / BIGSERIAL / nextval / TIMESTAMP.
   The gate lost all discriminating power (false positive die) and real violations
   would be hidden in the noise.
2. Table count assertion 36 != actual DDL 37 (grep -c CREATE TABLE IF NOT EXISTS = 37;
   the 37th table is pbl_compile_task, pbl_compiler domain 4 to 5). Related: the
   AUTOINC assertion used a literal multi-space pattern and missed the UNSIGNED single
   space variant of pbl_compile_task (counted 36, accidentally matching the old assert);
   L210 post-create information_schema assertion was also 36.

Fix:
- Add scripts/ddl_gate_check.py: strip_sql_noise() single-pass char scanner removing
  block comments, -- / # line comments (-- must be followed by whitespace, so a--b is
  safe) and single/double quoted string literals (with doubled and backslash escapes)
  replaced by a placeholder, so COMMENT strings and DEFAULT strings no longer interfere.
  Assertions run only on the denoised DDL body: zero dialect keyword hits (prints
  keyword + line number + line text), CREATE TABLE count = 37 (plus duplicate table and
  non pbl_ prefix checks), BIGINT [UNSIGNED] NOT NULL AUTO_INCREMENT = 37 (table option
  AUTO_INCREMENT=n excluded first). Ships --selftest with 9 minimal unit checks (no
  pytest needed) and --dump-body for debugging; expected values are module constants.
- Rewrite build.sh gate 6.4: step 4a runs --selftest first (if the scanner is not
  trustworthy its verdict is not accepted), step 4b runs the gate with
  --expect-tables 37 --expect-autoinc 37; return codes captured explicitly (not via
  "if ! cmd" which resets $? to 0); missing scanner file dies and forbids falling back
  to raw grep. Header comment and L210 actual table assertion synced 36 to 37.
- pbls_tables.sql trailing contract self-check block: total tables 36 to 37
  (pbl_compiler 4 to 5, new pbl_compile_task); the zero-hit section now describes the
  forbidden constructs in prose instead of listing SQL keywords verbatim (defence in
  depth against a future regression to naive grep).
- projects/pbls/env/test.json gate.build_sh text "36 tables" to "37 tables"
  (json.load validity self-check passed).

Verification (real local run output, details in
projects/pbls/docs/02-develop/dev-notes-deploy-q4-build-gate64.md):
- --selftest 9/9 PASS, including a negative fixture proving real violations are still
  caught, idempotency of denoising, and that -- / # inside strings do not truncate.
- Real DDL: denoising strips 10974 chars / 89 line comments / 493 string literals;
  dialect zero hits, CREATE TABLE = 37, AUTO_INCREMENT = 37, RESULT PASS rc=0.
- build.sh gate sections 0-4 sliced into a temporary harness and executed as a whole
  inside apps/pbls, rc=0 (6.1/6.2/6.4 all pass). Sections 7+ not entered: no MariaDB,
  no venv deps, port 9300 unavailable - honestly declared in the dev notes.
- bash -n build.sh passes; no live assertion still says 36 (only 2 comment lines).

No real table structure, app entry, conf/config.json, requirements or modules/pbl_*
were modified.
2026-09-25 08:37:51 +08:00
agent.develop
37961262b4 deliver: 交付收口(引擎代为提交) 2026-09-22 22:03:22 +08:00
agent.develop
8ac2694eee build(pbls): M9 收口——补齐 8c 模块 wwwroot 挂载步骤与应用侧可达性门禁 + 生成产物软链排除
- build.sh 新增「8c. 模块 wwwroot 挂载」:对所有含 wwwroot/ 的 pbl_* 模块执行
  ln -sfn "${mod_dir}/wwwroot" "${APP_DIR}/wwwroot/${mod_name}",并以应用侧路径
  find -L 实测页面壳数=12 作为门禁(不符即 die 终止部署),响应 QC 退回意见 #1/#2
  (生成步骤已接入但可达链路断在挂载环节)
- .gitignore 排除构建期生成的模块 wwwroot 软链(git 中软链非目录,模式不带结尾斜杠),
  并显式反排除应用仓自带的 wwwroot/pbl_overlay/(其 .js 为跟踪文件)
- 选择性 git add:仅 .gitignore 与 build.sh 两个文件,未使用 git add -A、未 add wwwroot/
- 自检:bash -n build.sh rc=0;gen_overlay_pages.py --check rc=0(打印生成+挂载两项均已接入)
2026-09-22 17:12:01 +08:00
agent.develop
fa7e8166fc build(pbls): 恢复完整 build.sh 并接入 M9 覆盖层页面壳生成步骤(8b 段)
- 从 f9b1f55 恢复 182 行完整一键部署脚本正文(此前收口提交误将 5 行索引占位
  作为交付事实,导致 die/log/${WS_DIR}/${PY} 等符号无定义、bash build.sh rc=127)
- 在模块安装循环(pip install -e modules/pbl_*)之后、py_compile/wwwroot 软链
  之前新增 8b 段:调用 modules/pbl_scense_ext/scripts/gen_overlay_pages.py 生成
  12 个覆盖层页面壳,并紧随其后以 --check 作为部署门禁,rc!=0 终止并打印原因
- 返回码用 GEN_RC/CHK_RC 显式捕获(不能用 if ! cmd 后取 $?,会被取反成 0)
2026-09-22 13:48:36 +08:00
agent.develop
efd1419a6a deliver: 交付收口(引擎代为提交) 2026-09-22 13:20:16 +08:00
agent.develop
f9b1f550a1 approve: 修正配置/文档 + 补 init/data.json 种子 2026-09-22 13:17:27 +08:00
agent.develop
f7b93ad1f7 deliver: 交付收口(引擎代为提交) 2026-09-16 15:32:49 +08:00
agent.develop
8d99405f8f develop(pbls): QC 退回整改——补齐 self_check/真实可编译代码/config processors/requirements 依赖 2026-09-16 11:46:13 +08:00
pbls-bot
a494bd23e6 feat(pbls): 初始提交 - pbls 项目模块代码入库 2026-09-15 17:39:29 +08:00