• 编码期测试的 DB 时序从「DROP+CREATE 空库 → Flyway 从零重建 → seed」
    改为「mysqldump 复制源库→一次性副本 → Flyway 只 apply 本轮新迁移 →
    跑测试 → 绿后晋升新迁移到源库 → 无论红绿删副本」。
    
    - 新模板 scripts/drop-test-db.mjs(删副本,硬拒删源库)、
      scripts/promote-to-source.mjs(移植 flyway 历史行+重放迁移到源库;
      跨 lane 串行由编排层 testGate 起栈互斥保证,文件锁兜底同树重跑)
    - setup-test-db:DROP 空库 → 复制源库到副本;test.mjs:try/finally
      删副本 + 绿后晋升 + 串行缺省显式导出副本名 <schema>__test
    - 命名约定(5 脚本共享):COPY = env > marker > <source>__test,
      每脚本 COPY===SOURCE 即拒绝;application*.yml 占位缺省改为副本名
    - 新 lib/bootstrap-source-flyway.mjs:db-init 建源库+apply V1+写
      checksum 与 Flyway 一致的历史行(Plan 期无 app 可起,手算 CRC32);
      db-init B 段三步换一次 bootstrap 调用
    - coding.mjs 各闸时序对齐;globalTeardown 只 kill 不删副本(teardown
      删副本会让其后的 promote 查不到副本历史而静默跳过晋升);行为门/
      seed 契约允许清单补 drop-test-db;前端 testGate 补收尾删副本
    - 模板测试重写 + 新增 drop/promote/bootstrap 测试(133 全绿,全离线)
    
    已知残留:bootstrap 手算 Flyway checksum 未真机验证(若不一致首次
    起后端报 checksum mismatch,改 flywayChecksum 一处即可);演示种子
    固定主键区间 1000–9999 与源库真实自增数据增长存在长期碰撞风险。
    zichun authored
     
    Browse Code »


  • zichun authored
     
    Browse File »
  • Replaces the phase-level read-only behavior-gate with a per-FE acceptance dimension: each FE is approved only when the code-reviewer approves AND runtime behavior verification is green. Behavior defects (dead control / sentinel text mismatch) become fixable must-fix that drive verify->fix->re-verify, not halts.
    
    - reviewWithFixLoop (frontend only, via if(fe)): at the approve gate, behaviorSubGate boots this FE's full stack + seeds sentinels, enumerates this FE's routes, two-tier asserts. Hard issues with a locator -> fixPrompt -> functional reverify -> next behaviorRound; soft text (i18n/literal/semantic) -> adjudicate(continue); behaviorRound bounded by BEHAVIOR_FE_MAX=3, env race by BEHAVIOR_ATTEMPT_MAX=2. Backend featureLoop branch unchanged.
    
    - New runFrontendSkeleton stage (before featureLoop(frontend)): App shell + full lazy router + FeStub placeholders + shared nav, so the app is buildable at every mid-phase point; tdd swaps FeStub->real component per FE. Idempotent via fe-skeleton-done tag.
    
    - BEHAVIOR_GATE_SCHEMA gains build-failed envError kind (sibling-FE-unimpl short-circuit, not a bug) + locator-not-resolvable coverage reason; deriveSpec emits a per-FE route-scope section, reviewer validates it.
    
    - Removed phase-level runBehaviorGate + 'Behavior' phase; kept phase-level testGate (regression). REVIEW_HARD_ROUNDS 8->10.
    
    - Safety: test-DB naming guard pushed into scripts-setup-test-db.mjs template (fail-closed unless name contains test/_dev/_local or ALLOW_NONTEST_DROP=1) + 3 tests.
    
    - agentType stays erp-workflow:code-reviewer. v1 design doc marked SUPERSEDED; v2 design at docs/design/2026-06-02-frontend-behavior-in-review-loop.md.
    
    Verified: wrapped syntax check SYNTAX_OK, 87/87 lib tests pass, no orphan refs, no time/random builtins, top-level return intact. Not yet run end-to-end against a real ERP project.
    zichun authored
     
    Browse File »

  • validate-ddl now recognizes the db-init A.1 DDL form (CREATE TABLE →
    CREATE INDEX → ALTER TABLE ADD FK), so schemas with out-of-body indexes/
    FKs no longer report false-positive index/FK diffs. Adds a second parse
    pass (mergeStandaloneIndexes / mergeStandaloneForeignKeys), string-literal
    blanking so DEFAULT/COMMENT text isn't mistaken for real DDL, backtick
    non-ASCII identifier support across all matchers (H3), and shared index-
    column normalization (strip backtick / prefix-length / ASC|DESC) on both
    docs and DDL sides. Chinese 主键/唯一 index labels map to PRIMARY/UNIQUE.
    
    apply-ddl resolves mysql2 from the target project dir (not the plugin),
    rejects 【人工填写】 credential placeholders before connecting, and exits 2
    on missing config/DDL paths. setup-test-db template validates schema as an
    ASCII identifier before interpolating it into DROP/CREATE. db-init gains a
    B.1 toolchain precheck (mysql2 module + mysql client) before any DROP.
    zichun authored
     
    Browse Code »