create-yss-spec 3.4.9 → 3.5.0
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.
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/api/_sync-service.js +111 -18
- package/src/cli/args.js +1 -0
- package/src/cli/help.js +10 -1
- package/src/cli/index.js +3 -0
- package/src/cli/prompts.js +5 -1
- package/src/cli/router.js +2 -0
- package/src/commands/attach.js +12 -2
- package/src/commands/init.js +2 -0
- package/src/commands/skills.js +253 -0
- package/src/commands/sync.js +3 -0
- package/src/family-identity.js +1 -1
- package/src/template/asset-runtime.js +220 -0
- package/src/template/attach-planner.js +5 -0
- package/src/template/distribution-runtime.js +165 -0
- package/src/template/instance-runtime.js +76 -29
- package/src/template/ownership-policy.js +17 -1
- package/src/template/prune-planner.js +6 -1
- package/src/template/sync-planner.js +8 -0
- package/src/template/verification-runtime.js +56 -1
- package/src/validation/metadata.js +24 -1
- package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
- package/template/.agents/skills/yss-cache/SKILL.md +6 -5
- package/template/.agents/skills/yss-cache/references/annotations.md +3 -1
- package/template/.agents/skills/yss-cache/references/architecture.md +4 -2
- package/template/.agents/skills/yss-cache/references/configuration.md +6 -3
- package/template/.agents/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.agents/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.agents/skills/yss-cache/references/verification.md +10 -4
- package/template/.agents/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.agents/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.agents/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.agents/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
- package/template/.agents/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.agents/skills/yss-openapi-draft-review/SKILL.md +2 -0
- package/template/.agents/skills/yss-openapi-governance/SKILL.md +4 -0
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +11 -5
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +68 -5
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +2 -2
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +8 -8
- package/template/.agents/skills/yss-prototype-stage/SKILL.md +4 -2
- package/template/.agents/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs +2 -2
- package/template/.agents/skills/yss-repository/SKILL.md +1 -0
- package/template/.agents/skills/yss-stage-decision/SKILL.md +2 -0
- package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -0
- package/template/.agents/skills/yss-technical-design/SKILL.md +2 -0
- package/template/.agents/skills/yss-technical-design/scripts/engineering-design.mjs +1 -1
- package/template/.agents/skills/yss-technical-design/scripts/validate-technical-design.mjs +11 -8
- package/template/.codex/skills/yss-cache/SKILL.md +6 -5
- package/template/.codex/skills/yss-cache/references/annotations.md +3 -1
- package/template/.codex/skills/yss-cache/references/architecture.md +4 -2
- package/template/.codex/skills/yss-cache/references/configuration.md +6 -3
- package/template/.codex/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.codex/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.codex/skills/yss-cache/references/verification.md +10 -4
- package/template/.codex/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.codex/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.codex/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.codex/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
- package/template/.codex/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.codex/skills/yss-openapi-draft-review/SKILL.md +2 -0
- package/template/.codex/skills/yss-openapi-governance/SKILL.md +4 -0
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +11 -5
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +68 -5
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +2 -2
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +8 -8
- package/template/.codex/skills/yss-prototype-stage/SKILL.md +4 -2
- package/template/.codex/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs +2 -2
- package/template/.codex/skills/yss-repository/SKILL.md +1 -0
- package/template/.codex/skills/yss-stage-decision/SKILL.md +2 -0
- package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -0
- package/template/.codex/skills/yss-technical-design/SKILL.md +2 -0
- package/template/.codex/skills/yss-technical-design/scripts/engineering-design.mjs +1 -1
- package/template/.codex/skills/yss-technical-design/scripts/validate-technical-design.mjs +11 -8
- package/template/.cursor/skills/yss-cache/SKILL.md +6 -5
- package/template/.cursor/skills/yss-cache/references/annotations.md +3 -1
- package/template/.cursor/skills/yss-cache/references/architecture.md +4 -2
- package/template/.cursor/skills/yss-cache/references/configuration.md +6 -3
- package/template/.cursor/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.cursor/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.cursor/skills/yss-cache/references/verification.md +10 -4
- package/template/.cursor/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.cursor/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.cursor/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.cursor/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
- package/template/.cursor/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.cursor/skills/yss-openapi-draft-review/SKILL.md +2 -0
- package/template/.cursor/skills/yss-openapi-governance/SKILL.md +4 -0
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +11 -5
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +68 -5
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +2 -2
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +8 -8
- package/template/.cursor/skills/yss-prototype-stage/SKILL.md +4 -2
- package/template/.cursor/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs +2 -2
- package/template/.cursor/skills/yss-repository/SKILL.md +1 -0
- package/template/.cursor/skills/yss-stage-decision/SKILL.md +2 -0
- package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -0
- package/template/.cursor/skills/yss-technical-design/SKILL.md +2 -0
- package/template/.cursor/skills/yss-technical-design/scripts/engineering-design.mjs +1 -1
- package/template/.cursor/skills/yss-technical-design/scripts/validate-technical-design.mjs +11 -8
- package/template/.pi/skills/yss-cache/SKILL.md +6 -5
- package/template/.pi/skills/yss-cache/references/annotations.md +3 -1
- package/template/.pi/skills/yss-cache/references/architecture.md +4 -2
- package/template/.pi/skills/yss-cache/references/configuration.md +6 -3
- package/template/.pi/skills/yss-cache/references/jetcache.md +21 -0
- package/template/.pi/skills/yss-cache/references/redis-fallback.md +5 -3
- package/template/.pi/skills/yss-cache/references/verification.md +10 -4
- package/template/.pi/skills/yss-cache/scripts/verify-cache-component.sh +26 -20
- package/template/.pi/skills/yss-distributed-id/SKILL.md +14 -58
- package/template/.pi/skills/yss-distributed-id/agents/openai.yaml +2 -2
- package/template/.pi/skills/yss-distributed-id/references/README.md +11 -47
- package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -0
- package/template/.pi/skills/yss-mybatis/SKILL.md +14 -2
- package/template/.pi/skills/yss-openapi-draft-review/SKILL.md +2 -0
- package/template/.pi/skills/yss-openapi-governance/SKILL.md +4 -0
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +11 -5
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +68 -5
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +2 -2
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +8 -8
- package/template/.pi/skills/yss-prototype-stage/SKILL.md +4 -2
- package/template/.pi/skills/yss-prototype-stage/scripts/visual-baseline-contract.mjs +2 -2
- package/template/.pi/skills/yss-repository/SKILL.md +1 -0
- package/template/.pi/skills/yss-stage-decision/SKILL.md +2 -0
- package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -0
- package/template/.pi/skills/yss-technical-design/SKILL.md +2 -0
- package/template/.pi/skills/yss-technical-design/scripts/engineering-design.mjs +1 -1
- package/template/.pi/skills/yss-technical-design/scripts/validate-technical-design.mjs +11 -8
- package/template/AGENTS.md +2 -0
- package/template/CONTEXT.md +2 -1
- package/template/README.md +3 -5
- package/template/docs/agents/issue-tracker.md +7 -0
- package/template/docs/agents/skill-migrations.md +4 -0
- package/template/docs/agents/yss-skill-registry.yaml +7 -6
- package/template/docs/design/README.md +0 -1
- package/template/docs/design/design.md +2 -2
- package/template/docs/design/templates/interaction-spec-template.md +1 -1
- package/template/docs/engineering/evidence/aliyun-artifact-resolution.json +446 -0
- package/template/docs/process/contract-reading.md +46 -0
- package/template/docs/process/lifecycle-artifact-map.md +2 -2
- package/template/docs/process/lifecycle-registry-baseline.json +2 -1
- package/template/docs/process/lifecycle-registry.yaml +10 -4
- package/template/docs/process/schemas/api-contract-decision-v2.schema.json +198 -0
- package/template/docs/process/schemas/digital-human-task-package.schema.json +8 -0
- package/template/docs/process/schemas/lifecycle-checkpoint.schema.json +259 -0
- package/template/docs/process/schemas/stage-tracking.schema.json +259 -0
- package/template/docs/process/stage-tracking.md +62 -0
- package/template/docs/process/strategic-handoff-package.md +8 -0
- package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +2 -0
- package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +1 -0
- package/template/docs/user-guide//351/230/266/346/256/265/346/216/245/345/205/245/344/270/216/344/272/247/347/211/251/345/244/215/347/224/250/344/275/277/347/224/250/346/211/213/345/206/214.md +243 -0
- package/template/scripts/api-contract-decision +16 -0
- package/template/scripts/complete-backend-delivery +17 -0
- package/template/scripts/contract +13 -0
- package/template/scripts/design-md +2 -0
- package/template/scripts/dispatch-slice-task +13 -0
- package/template/scripts/lib/api-contract-decision.mjs +45 -4
- package/template/scripts/lib/approval-record.mjs +1 -1
- package/template/scripts/lib/approved-execution-context.mjs +35 -7
- package/template/scripts/lib/backend-architecture.mjs +2 -2
- package/template/scripts/lib/backend-delivery-terminal.mjs +51 -0
- package/template/scripts/lib/backend-platform-provenance.mjs +1 -1
- package/template/scripts/lib/backend-platform.mjs +1 -1
- package/template/scripts/lib/backend-scaffold-prerequisites.mjs +1 -1
- package/template/scripts/lib/context-contract.mjs +1 -1
- package/template/scripts/lib/context-reconciliation.mjs +1 -1
- package/template/scripts/lib/contract-source.mjs +22 -0
- package/template/scripts/lib/contract-views.mjs +109 -0
- package/template/scripts/lib/delivery-preflight.mjs +3 -2
- package/template/scripts/lib/design-md.mjs +230 -0
- package/template/scripts/lib/digital-human-roles.mjs +1 -1
- package/template/scripts/lib/existing-backend-architecture.mjs +4 -3
- package/template/scripts/lib/existing-ui-baseline.mjs +4 -2
- package/template/scripts/lib/frontend-delivery-boundary.mjs +1 -1
- package/template/scripts/lib/frontend-delivery.mjs +1 -1
- package/template/scripts/lib/harness-execution-scope.mjs +15 -1
- package/template/scripts/lib/implementation-contract-compiler.mjs +4 -4
- package/template/scripts/lib/json-schema.mjs +19 -4
- package/template/scripts/lib/lifecycle-context-query.mjs +5 -1
- package/template/scripts/lib/lifecycle-controls.mjs +1 -1
- package/template/scripts/lib/lifecycle-execution-scope.mjs +92 -0
- package/template/scripts/lib/lifecycle-registry.mjs +2 -1
- package/template/scripts/lib/lifecycle-transition.mjs +21 -3
- package/template/scripts/lib/openapi-draft-validation.mjs +2 -1
- package/template/scripts/lib/skill-registry.mjs +10 -3
- package/template/scripts/lib/skill-supply-chain.mjs +33 -14
- package/template/scripts/lib/slice-contract-preparation.mjs +16 -14
- package/template/scripts/lib/slice-contract-views.mjs +1 -1
- package/template/scripts/lib/slice-contract.mjs +18 -3
- package/template/scripts/lib/slice-execution-preflight.mjs +7 -3
- package/template/scripts/lib/slice-repositories.mjs +1 -1
- package/template/scripts/lib/slice-task-package.mjs +3 -2
- package/template/scripts/lib/stage-tracking-migration.mjs +176 -0
- package/template/scripts/lib/stage-tracking.mjs +184 -0
- package/template/scripts/lib/strategic-handoff-consumption.mjs +5 -4
- package/template/scripts/lib/strategic-handoff-io.mjs +5 -2
- package/template/scripts/lib/strategic-handoff-routing.mjs +31 -0
- package/template/scripts/lib/strategic-handoff.mjs +4 -2
- package/template/scripts/lib/task-package.mjs +2 -0
- package/template/scripts/lib/technical-design-boundary.mjs +4 -2
- package/template/scripts/lib/ui-baseline.mjs +1 -1
- package/template/scripts/lib/user-decision.mjs +1 -1
- package/template/scripts/lib/validation-phase.mjs +72 -0
- package/template/scripts/stage-tracking +25 -0
- package/template/scripts/strategic-consumer-entry +47 -0
- package/template/scripts/verify-context-reconciliation +4 -3
- package/template/scripts/verify-lifecycle-checkpoint +10 -0
- package/template/scripts/verify-project-instance +11 -10
- package/template/skills-lock.json +17 -32
- package/template.manifest.json +18 -3
- package/template.snapshot.json +5 -5
- package/template/.agents/skills/grill-me/SKILL.md +0 -7
- package/template/.agents/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.agents/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.agents/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.agents/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.codex/skills/grill-me/SKILL.md +0 -7
- package/template/.codex/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.codex/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.codex/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.codex/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.cursor/skills/grill-me/SKILL.md +0 -7
- package/template/.cursor/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.cursor/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.cursor/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.cursor/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/.pi/skills/grill-me/SKILL.md +0 -7
- package/template/.pi/skills/grill-me/agents/openai.yaml +0 -5
- package/template/.pi/skills/yss-distributed-id/assets/AutoIdInterceptor.java +0 -246
- package/template/.pi/skills/yss-distributed-id/assets/EnableDistributedId.java +0 -25
- package/template/.pi/skills/yss-distributed-id/assets/LeafConf.java +0 -36
- package/template/docs/agents/yss-plugin-dependency-contract.md +0 -45
- package/template/docs/api/.gitkeep +0 -0
- package/template/docs/api/specs/.gitkeep +0 -0
- package/template/docs/architecture/.gitkeep +0 -0
- package/template/docs/design/facts/antdv-next/1.5.2/cli-help.txt +0 -38
- package/template/docs/design/facts/antdv-next/1.5.2/component-list.json +0 -434
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/info.json +0 -246
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/semantic.json +0 -40
- package/template/docs/design/facts/antdv-next/1.5.2/components/Alert/token.json +0 -32
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/info.json +0 -190
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/semantic.json +0 -20
- package/template/docs/design/facts/antdv-next/1.5.2/components/Button/token.json +0 -256
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/info.json +0 -460
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Input/token.json +0 -123
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/info.json +0 -646
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/semantic.json +0 -50
- package/template/docs/design/facts/antdv-next/1.5.2/components/Modal/token.json +0 -130
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/info.json +0 -640
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Select/token.json +0 -172
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/info.json +0 -1010
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/semantic.json +0 -70
- package/template/docs/design/facts/antdv-next/1.5.2/components/Table/token.json +0 -263
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/demo-basic.json +0 -7
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/info.json +0 -321
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/semantic.json +0 -25
- package/template/docs/design/facts/antdv-next/1.5.2/components/Tag/token.json +0 -25
- package/template/docs/design/facts/antdv-next/1.5.2/design-md.json +0 -3
- package/template/docs/design/facts/antdv-next/1.5.2/manifest.json +0 -215
- package/template/docs/design/facts/antdv-next/1.5.2/resolution-probe.json +0 -5
- package/template/docs/design/prototypes/.gitkeep +0 -1
- package/template/docs/implementation/.gitkeep +0 -1
- package/template/docs/plan/IDEATION.md +0 -96
- package/template/docs/process/PDCA-SCRUM.md +0 -10
- package/template/docs/process/harness-executive-blueprint.md +0 -10
- package/template/docs/releases/.gitkeep +0 -1
- package/template/docs/requirements/README.md +0 -85
- package/template/docs/requirements/tickets/.gitkeep +0 -1
- package/template/docs/templates/agent-brief-template.md +0 -46
- package/template/docs/templates/architecture-proposal-template.md +0 -18
- package/template/docs/templates/implementation-plan-template.md +0 -16
- package/template/docs/templates/implementation-routing-template.md +0 -350
- package/template/docs/templates/requirement-freeze-template.md +0 -63
- package/template/docs/templates/risk-register-template.md +0 -11
- package/template/docs/templates/user-story-template.md +0 -20
- package/template/docs/testing/README.md +0 -110
|
@@ -5,6 +5,8 @@ description: 编排 Plan 到 Spec 入口的方案决策与业务边界、协作
|
|
|
5
5
|
|
|
6
6
|
# YSS Stage Decision
|
|
7
7
|
|
|
8
|
+
已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
|
|
9
|
+
|
|
8
10
|
`yss-stage-decision` 是由生命周期主控调度的上游决策技能,负责把需求、产品、商务输入和业务边界与规则设计结果整理成可审查、可版本化、可被下游消费的方案决策包。它不替代生命周期主控,也不生成产品代码、原型、OpenAPI 或垂直切片 Ticket。
|
|
9
11
|
|
|
10
12
|
文档输出时按 `lifecycle-document-output` 条件调用 `i-have-adhd`,读取 `docs/process/document-writing.md`;作用域仅限当前产物,派发时传递条件及引用。
|
|
@@ -5,6 +5,8 @@ description: 在 YSS 技术分析阶段将批准的战略领域输入细化为
|
|
|
5
5
|
|
|
6
6
|
# yss-tactical-design
|
|
7
7
|
|
|
8
|
+
已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
|
|
9
|
+
|
|
8
10
|
本 skill 负责 DDD 战术设计,不新增生命周期主阶段,也不替代 `yss-stage-decision` 或 `yss-domain`。
|
|
9
11
|
|
|
10
12
|
## 适用边界
|
|
@@ -5,6 +5,8 @@ description: 在 YSS 技术分析中统一承接需求与战略输入,按已
|
|
|
5
5
|
|
|
6
6
|
# YSS 技术设计
|
|
7
7
|
|
|
8
|
+
已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
|
|
9
|
+
|
|
8
10
|
由 `yss-product-lifecycle` 调度,负责 `work-unit.technical-analysis` 的技术设计,不另起生命周期、不生成生产代码。生命周期维护批准和状态;`yss-implementation-contract-compiler` 消费批准且当前的设计,起草实现合同。
|
|
9
11
|
|
|
10
12
|
文档输出时按 `lifecycle-document-output` 条件调用 `i-have-adhd`,读取 `docs/process/document-writing.md`;作用域仅限当前产物,派发时传递条件及引用。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import {readFileSync} from '
|
|
2
|
+
import {readFileSync} from '../../../../scripts/lib/validation-phase.mjs';
|
|
3
3
|
import {ensure,read,safe,hash} from '../../../../scripts/lib/strategic-handoff-io.mjs';
|
|
4
4
|
const beneath=(ref,scope)=>ref===scope||ref.startsWith(`${scope}/`);
|
|
5
5
|
export function validateEngineeringDesign(data,{root}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readFileSync } from '
|
|
2
|
+
import { readFileSync, withValidationPhase, validationDependencies } from '../../../../scripts/lib/validation-phase.mjs';
|
|
3
3
|
import { validateEngineeringDesign } from './engineering-design.mjs';
|
|
4
4
|
import { createApprovedExecutionContext, assertApprovedExecutionContext } from '../../../../scripts/lib/approved-execution-context.mjs';
|
|
5
5
|
import { verifyArchitectureEvidence } from '../../../../scripts/lib/backend-architecture.mjs';
|
|
@@ -42,8 +42,8 @@ function validateMvc(design) {
|
|
|
42
42
|
if (!design.integration_catalog.length) ensure(text(design.integration_not_applicable_reason), '无外部集成必须说明原因');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export function verifyArchitecture(data, root, {execution,sliceRef}={}) {
|
|
46
|
-
if(execution)assertApprovedExecutionContext(execution,{root,technicalDesign:data,sliceId:sliceRef});
|
|
45
|
+
export function verifyArchitecture(data, root, {execution,sliceRef,readOnly=false}={}) {
|
|
46
|
+
if(execution)assertApprovedExecutionContext(execution,{root,technicalDesign:data,sliceId:sliceRef,readOnly});
|
|
47
47
|
const binding = data.architecture;
|
|
48
48
|
const file = safe(root, binding.decision_ref);
|
|
49
49
|
ensure(hash(readFileSync(file)) === binding.decision_digest, '架构来源摘要漂移');
|
|
@@ -63,7 +63,7 @@ export function verifyArchitecture(data, root, {execution,sliceRef}={}) {
|
|
|
63
63
|
ensure(!['stale','blocked'].includes(record.status) && !['stale','blocked'].includes(entry.status), '工程登记已失效');
|
|
64
64
|
if (entry.architecture_identity?.schema_version === 2) {
|
|
65
65
|
ensure(entry.architecture_evidence?.engineering_baseline && entry.architecture_evidence?.manifest, '既有工程登记缺少原始工程证据引用');
|
|
66
|
-
verifyArchitectureEvidence(entry.architecture_identity, { ...entry.architecture_evidence, repository_registration: { ref: binding.decision_ref, digest: binding.decision_digest } }, { root, execution });
|
|
66
|
+
verifyArchitectureEvidence(entry.architecture_identity, { ...entry.architecture_evidence, repository_registration: { ref: binding.decision_ref, digest: binding.decision_digest } }, { root, execution, readOnly });
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -111,7 +111,7 @@ export async function validateTechnicalDesign(data, { root = process.cwd(), slic
|
|
|
111
111
|
ensure(data.digest === technicalDigest(data), '技术设计合同摘要不匹配');
|
|
112
112
|
ensure(!['stale','blocked','drift','new_impacts'].includes(data.status), '设计状态不可消费');
|
|
113
113
|
if (sliceRef) ensure(data.status === 'approved', '切片只能消费 approved 设计');
|
|
114
|
-
verifyArchitecture(data, root, {execution,sliceRef});
|
|
114
|
+
verifyArchitecture(data, root, {execution,sliceRef,readOnly});
|
|
115
115
|
ensure(data.inputs.some(item => item.kind === 'context' && item.ref === 'CONTEXT.md') && data.inputs.some(item => item.kind === 'spec'), '共同输入缺少根 CONTEXT.md 或 Spec');
|
|
116
116
|
for (const input of data.inputs) ensure(hash(readFileSync(safe(root, input.ref))) === input.digest, `输入摘要漂移: ${input.ref}`);
|
|
117
117
|
for (const ref of data.evidence_refs) safe(root, ref);
|
|
@@ -135,12 +135,15 @@ export async function validateTechnicalDesign(data, { root = process.cwd(), slic
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
async function main() {
|
|
138
|
-
const { values, positionals } = parseArgs({ allowPositionals: true, options: { root: { type: 'string', default: process.cwd() }, slice: { type: 'string' }, 'legacy-ddd': { type: 'boolean', default: false }, 'read-only': {type:'boolean',default:false}, 'work-unit': {type:'string'}, 'approved-slice': {type:'string'}, 'approved-slice-digest': {type:'string'}, 'approved-slice-approval': {type:'string'} } });
|
|
138
|
+
const { values, positionals } = parseArgs({ allowPositionals: true, options: { root: { type: 'string', default: process.cwd() }, slice: { type: 'string' }, 'legacy-ddd': { type: 'boolean', default: false }, 'read-only': {type:'boolean',default:false}, 'validation-dependencies': {type:'boolean',default:false}, 'work-unit': {type:'string'}, 'approved-slice': {type:'string'}, 'approved-slice-digest': {type:'string'}, 'approved-slice-approval': {type:'string'} } });
|
|
139
139
|
ensure(positionals.length === 1, '用法: validate-technical-design.mjs <合同> --root <项目根> [--slice <ID>] [--legacy-ddd]');
|
|
140
140
|
const approvedOptions=['approved-slice','approved-slice-digest','approved-slice-approval'];
|
|
141
141
|
ensure(!approvedOptions.some(key=>values[key])||approvedOptions.every(key=>values[key]),'执行增量必须完整给出持久化 Slice、字节摘要及本地批准引用');
|
|
142
|
-
const
|
|
142
|
+
const output=await withValidationPhase({root:values.root,purpose:'technical-design',slice_id:values.slice,work_unit_id:values['work-unit'],readOnly:values['read-only']},async()=>{
|
|
143
|
+
const execution=values['approved-slice']?createApprovedExecutionContext({ref:values['approved-slice'],digest:values['approved-slice-digest'],approval_ref:values['approved-slice-approval']},{root:values.root,work_unit_id:values['work-unit'],readOnly:values['read-only']}):undefined;
|
|
143
144
|
const result = await validateTechnicalDesign(read(path.resolve(positionals[0])), { root: values.root, sliceRef: values.slice, legacyDdd: values['legacy-ddd'], readOnly:values['read-only'], execution });
|
|
144
|
-
|
|
145
|
+
return values['validation-dependencies']?{...result,validation_dependencies:validationDependencies()}:result;
|
|
146
|
+
});
|
|
147
|
+
process.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
|
|
145
148
|
}
|
|
146
149
|
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) main().catch(error => { process.stderr.write(`${JSON.stringify({ result: 'blocked', errors: [error.message] })}\n`); process.exitCode = 1; });
|
|
@@ -10,8 +10,8 @@ description: "接入或排查 YSS QueryCache、UpdateCache、ClearCache、TTL、
|
|
|
10
10
|
## 工作流
|
|
11
11
|
|
|
12
12
|
1. 按 `yss-skill-source-index-refresh/references/source-location.md` 定位真实源码。当前工作区有 `.codegraph/` 时先用 CodeGraph;否则读取 [source-index.md](references/source-index.md) 后用符号或 Maven 模块搜索。
|
|
13
|
-
2. 识别使用模型:Spring Cache 单后端路由、Redis
|
|
14
|
-
3. 明确缓存名、key
|
|
13
|
+
2. 识别使用模型:Spring Cache 单后端路由、Redis 故障处理,或独立的 JetCache local + remote。`fail-fast`/`bypass`/`fallback` 是当前 Boot 3 Redis 契约;Boot 2 以其独立源码索引为准,不要混用两代或三种模型的行为假设。
|
|
14
|
+
3. 明确缓存名、key、区域 TTL/容量/空值策略、更新/删除路径、跨节点一致性和序列化兼容要求。
|
|
15
15
|
4. 先检查现有依赖、启动注解、配置和注解用法,再决定修改业务代码、配置还是组件。
|
|
16
16
|
5. 修改后执行对应 reference 的验证;组件跨模块修改必须从父 reactor 构建,不要依赖本地旧 SNAPSHOT。
|
|
17
17
|
|
|
@@ -20,13 +20,14 @@ description: "接入或排查 YSS QueryCache、UpdateCache、ClearCache、TTL、
|
|
|
20
20
|
- 新增查询缓存时同时覆盖更新、删除和状态变更的失效路径。
|
|
21
21
|
- key 必须稳定并显式包含租户、机构、账套等隔离维度;不要依赖 DTO 的不稳定序列化结果。
|
|
22
22
|
- 不要把 Redis fallback 当作正常二级缓存。Caffeine fallback 存在节点间不一致窗口。
|
|
23
|
-
- 不要声称纯 Redis
|
|
23
|
+
- 不要声称纯 Redis 后端会广播本地缓存失效。JetCache 即使存在 broadcast channel 配置,也须验证实际 local/remote 实例和同步开关后才能作此判断。
|
|
24
24
|
- 不要在没有双读、版本前缀、灰度清理或迁移窗口时修改 serializer、key prefix 或 cache name。
|
|
25
25
|
- 不明确一致性要求时,不默认启用本地缓存或 fallback。
|
|
26
26
|
|
|
27
27
|
## 按场景读取
|
|
28
28
|
|
|
29
29
|
- 模块、后端选择或多级缓存边界:[architecture.md](references/architecture.md)
|
|
30
|
+
- JetCache 包装器、`QuickConfig`、跨 JVM 失效与故障边界:[jetcache.md](references/jetcache.md)
|
|
30
31
|
- 新增或修改缓存注解、SpEL、空 key、全量清理:[annotations.md](references/annotations.md)
|
|
31
32
|
- 依赖、启动注解、TTL、Caffeine/Hazelcast、Bean backoff:[configuration.md](references/configuration.md)
|
|
32
33
|
- Redis 单机、哨兵、集群、认证、SSL、超时、Jedis pool:[redis-topology.md](references/redis-topology.md)
|
|
@@ -38,10 +39,10 @@ description: "接入或排查 YSS QueryCache、UpdateCache、ClearCache、TTL、
|
|
|
38
39
|
## 工具
|
|
39
40
|
|
|
40
41
|
- `scripts/inspect-cache-usage.sh <project-root>`:只读扫描消费项目;发现阻断缺陷返回 1,输入或环境错误返回 2。
|
|
41
|
-
- `scripts/verify-cache-component.sh [--source-root PATH] [--consumer-root PATH --consumer-module MODULE]
|
|
42
|
+
- `scripts/verify-cache-component.sh --platform-line <boot2-java8|boot3-java17> [--source-root PATH] [--consumer-root PATH --consumer-module MODULE]`:从匹配的平台源码根干净构建,验证组件、可用时的真实 Redis、对应 Java 字节码及可选消费模块。
|
|
42
43
|
- `scripts/check-skill-freshness.sh <boot2-java8|boot3-java17> [source-root]`:比较所选平台线的技能契约与当前组件源码;发现平台错配或漂移返回 1。
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
本 Skill 中新增的 `failure-mode`、区域策略和 `empty-key-eviction` 指引针对当前 Boot 3 组件;Boot 2 的精确配置与默认值须查其独立索引及源码。组件源码形成干净、固定的来源后,用 `yss-skill-source-index-refresh` 刷新所选平台的生成索引,再运行 freshness 检查。`source-index.md` 是平台选择页;不要手工修改生成索引或把 dirty 工作树的观察说成已核验事实。
|
|
45
46
|
|
|
46
47
|
## 平台与源码门禁
|
|
47
48
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 注解契约
|
|
2
2
|
|
|
3
|
+
以下 `empty-key-eviction` 可配置行为针对当前 Boot 3 / Java 17 组件;Boot 2 的空 key 处理以其独立源码索引和当前源码为准。
|
|
4
|
+
|
|
3
5
|
## 映射
|
|
4
6
|
|
|
5
7
|
- `@QueryCache` -> Spring `CacheableOperation`。
|
|
@@ -28,7 +30,7 @@ public void delete(String tenantId, Long planId) { ... }
|
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
- 未配置 key 时由 Spring KeyGenerator 生成;无参数方法会得到 `SimpleKey.EMPTY`。
|
|
31
|
-
- 当前
|
|
33
|
+
- 当前 Boot 3 的 `yss.cache.empty-key-eviction=legacy-clear`(默认)把 `SimpleKey.EMPTY` 当作清区;`evict` 时只删该 key。迁移前核对原有无参数清理调用及实际属性,不能把默认行为说成所有配置下的不变量。
|
|
32
34
|
- 全量清理优先显式写 `allEntries=true`,不要依赖偶然 key 形态。
|
|
33
35
|
- 集合参数先稳定排序;null、大小写和空白必须归一化。
|
|
34
36
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# 架构与选择
|
|
2
2
|
|
|
3
|
+
以下模型划分适用于接入决策;具体配置、默认值及跨节点行为按所选平台线的当前源码核验。本轮新增的 Redis 故障模式、区域策略和 JetCache 运行证据属于 Boot 3 当前组件。
|
|
4
|
+
|
|
3
5
|
## 三种模型
|
|
4
6
|
|
|
5
7
|
| 模型 | 行为 | 一致性边界 |
|
|
6
8
|
|---|---|---|
|
|
7
9
|
| Spring Cache 后端路由 | `yss.cache.active-type` 在 Redis、Caffeine、Hazelcast 中选择一个 Provider | 同一时刻是单后端,不是多级缓存 |
|
|
8
10
|
| Redis fallback | Redis 故障时可临时改用另一个 Provider | 是故障降级;Caffeine 会产生节点间不一致窗口 |
|
|
9
|
-
| JetCache | 独立扩展,可配置 local + remote |
|
|
11
|
+
| JetCache | 独立扩展,可配置 local + remote | broadcast channel 配置本身不证明包装器已启用跨 JVM 本地失效同步 |
|
|
10
12
|
|
|
11
13
|
## 模块
|
|
12
14
|
|
|
@@ -22,4 +24,4 @@
|
|
|
22
24
|
- 跨节点共享且不接受节点本地旧值:使用纯 Redis。
|
|
23
25
|
- 读多写少并允许短暂节点差异:可选择 Caffeine。
|
|
24
26
|
- Redis 故障期间业务可用性高于缓存一致性:评估后启用 fallback。
|
|
25
|
-
- 需要 local + remote
|
|
27
|
+
- 需要 local + remote:按 [JetCache 专项参考](jetcache.md) 核对实际创建的 Cache、配置来源及首次创建参数,并用跨 JVM 测试证明同步,不要只看依赖或 `bootstrap.yml`。
|
|
@@ -13,20 +13,23 @@
|
|
|
13
13
|
|
|
14
14
|
## 公共属性
|
|
15
15
|
|
|
16
|
+
以下示例及 `failure-mode`、区域策略、空值策略说明针对当前 Boot 3 / Java 17 组件。Boot 2 / Java 8 维护须先核对其独立源码索引与匹配源码,不套用这些新属性或默认值。
|
|
17
|
+
|
|
16
18
|
```yaml
|
|
17
19
|
yss:
|
|
18
20
|
cache:
|
|
19
21
|
active-type: redis # redis | caffeine | hazelcast
|
|
20
22
|
default-ttl: 1h
|
|
23
|
+
failure-mode: fail-fast # fail-fast | bypass | fallback;仅 active-type=redis
|
|
21
24
|
redis:
|
|
22
25
|
fallback-enabled: false
|
|
23
26
|
fallback-type: caffeine
|
|
24
27
|
clear-fallback-on-recovery: true
|
|
25
28
|
```
|
|
26
29
|
|
|
27
|
-
-
|
|
28
|
-
- `CacheKeyCode`
|
|
29
|
-
- Caffeine
|
|
30
|
+
- `failure-mode` 默认 fail-fast;旧 `redis.fallback-enabled=true` 仍映射 fallback,同时配置为冲突值会拒绝启动。bypass 仅将 Redis 连接/资源故障的查询视为 miss,显式写入和失效仍报告错误;业务与序列化异常不降级。fallback 仅可选择已安装的 Caffeine,不是默认二级缓存。
|
|
31
|
+
- 区域 `yss.cache.regions[区域名]` 可逐字段设置 `ttl`、`caffeine-maximum-size`、`null-policy`。TTL 以区域值优先;Caffeine 用户显式过期策略、`CacheKeyCode` 与 `default-ttl` 的实际优先级按当前组件源码核对。`null-policy=cache` 必须指定正的区域 TTL;`skip` 不等于删除旧值,`reject` 的契约错误不能吞成 Redis 故障。
|
|
32
|
+
- Caffeine `spring.cache.caffeine.spec`、自定义 Builder/Loader 与区域覆盖的组合可能无法表达;核对当前组件的启动拒绝条件。自定义 CacheManager/Provider 时需证明区域策略真实生效,不能因配置存在就宣称 TTL、容量或空值策略已应用。
|
|
30
33
|
- Hazelcast 不在 starter 生产依赖中;使用时显式引入模块并配置 `active-type=hazelcast`。
|
|
31
34
|
|
|
32
35
|
## 自定义 Bean
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# JetCache 独立接入与验证
|
|
2
|
+
|
|
3
|
+
本页记录当前 Boot 3 / Java 17 `yss-component-jetcache` 工作树的接入判断;Boot 2 的精确能力以其平台索引和匹配源码为准。JetCache 与 YSS Spring Cache 是两条独立入口,不继承 `yss.cache.active-type`、区域 TTL 或 Redis `failure-mode`。
|
|
4
|
+
|
|
5
|
+
## 先确认实际入口
|
|
6
|
+
|
|
7
|
+
- 检查运行时上游 `CacheManager`、local/remote builder、应用自己的 JetCache 配置及实际创建的 area/name。依赖 JAR 中有 `bootstrap.yml` 不证明应用加载了它;无有效 local builder 时,LOCAL 请求可能在运行时失败。
|
|
8
|
+
- 组件兼容包装器的两参数 `getCache` 默认 TTL 为 5 分钟,重载接收 `Duration`;它不设置 `syncLocal`、loader 或刷新策略。包装器的类型映射也不证明 LOCAL 实际采用 Caffeine。需要这些能力时核对原生 `QuickConfig` 与上游管理器。
|
|
9
|
+
- 管理器按 area/name 复用已创建缓存。类型、TTL、`syncLocal` 等参数在第一次创建时确定,后续 `getOrCreateCache` 不会重建同名缓存;修改配置须使用新名称或明确的生命周期切换。
|
|
10
|
+
|
|
11
|
+
## 跨 JVM 本地失效
|
|
12
|
+
|
|
13
|
+
原生 `QuickConfig` 选择 `BOTH`、设置 `syncLocal(true)`,并为所有参与节点配置兼容的 `jetcache.remote.default.broadcastChannel`、编码及相同 area/name。包装器即使存在广播频道也不会自行开启 `syncLocal`;缺频道时不能据 `syncLocal(true)` 宣称已同步。
|
|
14
|
+
|
|
15
|
+
验收时启动两个独立 JVM,在两端创建同名缓存,确认广播订阅实际建立后,从一端更新和删除并观察另一端本地值失效;同时用未同步的对照缓存确认失效范围。广播是异步通知,不承诺强一致或断连期间的持久补偿。
|
|
16
|
+
|
|
17
|
+
## 故障与数据格式
|
|
18
|
+
|
|
19
|
+
- 读取 `CacheResult` 状态来区分未命中和故障;便利 `get`/`getValue` 可能将远端故障折叠为 `null`。REMOTE 与 BOTH 的故障结果也不同,不能套用主线 Redis 的 fail-fast/bypass/fallback。
|
|
20
|
+
- JetCache Java 编码保存 `CacheValueHolder`,与 Spring RedisCache 的 JDK 业务值及 RedisTemplate 的 Jackson 值不同。缓存名称、key 前缀或 serializer 迁移前,核对实际物理 key 和兼容方案,避免混写。
|
|
21
|
+
- 包装器不提供主线缓存的事务后提交协调。刷新须核对原生 loader 与 refresh policy 是否同时配置;本轮未验证多节点刷新去重、断连补偿或生产 SLA。
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# Redis 故障降级与恢复
|
|
2
2
|
|
|
3
|
+
以下故障模式和脏 Redis 区域恢复顺序是当前 Boot 3 / Java 17 组件契约。Boot 2 / Java 8 的故障处理和恢复默认值须单独核对其索引及源码。
|
|
4
|
+
|
|
3
5
|
## 状态流
|
|
4
6
|
|
|
5
7
|
```text
|
|
6
8
|
Redis 健康 -> 命令或健康检查失败 -> 标记不健康 -> 跳过 Redis
|
|
7
9
|
-> 可选 fallback -> 周期健康检查 -> Redis 可连接
|
|
8
|
-
-> 清理脏 Redis cache
|
|
10
|
+
-> 清理脏 Redis cache;按配置清理本地 fallback cache -> 恢复 Redis
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
- fallback 默认关闭,默认目标是 Caffeine。
|
|
@@ -13,11 +15,11 @@ Redis 健康 -> 命令或健康检查失败 -> 标记不健康 -> 跳过 Redis
|
|
|
13
15
|
- Redis 命令级连接故障也会立即报告不健康,不必等待下一轮检查。
|
|
14
16
|
- 只读 fallback 不标记 Redis cache 为脏。
|
|
15
17
|
- put、putIfAbsent、evict、clear、invalidate 和 valueLoader 产生的回退写入会标记为脏。
|
|
16
|
-
-
|
|
18
|
+
- 恢复时始终先清理降级期间发生写操作的 Redis cache;`clear-fallback-on-recovery=true` 时还清理本地 fallback cache。
|
|
17
19
|
- Redis 失效失败时继续保持不健康状态并在后续检查重试,不能提前切回旧 Redis 数据。
|
|
18
20
|
|
|
19
21
|
## 一致性判断
|
|
20
22
|
|
|
21
23
|
- Caffeine fallback 是每节点独立数据,不能保证跨节点读到相同值。
|
|
22
|
-
- `clear-fallback-on-recovery=false`
|
|
24
|
+
- `clear-fallback-on-recovery=false` 只跳过本地备用缓存清理,不跳过脏 Redis 区域失效。Redis 失效失败时不切回;关闭本地清理仍须评估后续备用使用时的本地旧值窗口。
|
|
23
25
|
- 强一致、锁、幂等状态或余额类数据不应依赖缓存 fallback 保证正确性。
|
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
## 组件
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
./mvnw -f yss-microservice-components/yss-component-cache-parent/pom.xml verify
|
|
6
|
+
./mvnw -f yss-microservice-components/yss-component-cache-parent/pom.xml clean verify
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
跨模块测试使用父 reactor 的 `-pl <module> -am`,避免解析本地旧 SNAPSHOT。也可运行:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
scripts/verify-cache-component.sh --source-root /path/to/yss-cloud-microservice
|
|
12
|
+
scripts/verify-cache-component.sh --platform-line boot3-java17 --source-root /path/to/boot3/yss-cloud-microservice
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
运行前将 `JAVA_HOME` 与 `PATH` 设为所选平台的 JDK(Boot 2 为 Java 8,Boot 3 为 Java 17);脚本从 `clean verify` 后的每个 cache class 检查 major,无法读取任一 class 即失败。
|
|
16
|
+
|
|
15
17
|
## 消费项目
|
|
16
18
|
|
|
17
19
|
```bash
|
|
@@ -22,13 +24,17 @@ scripts/verify-cache-component.sh --source-root /path/to/yss-cloud-microservice
|
|
|
22
24
|
|
|
23
25
|
## 验收矩阵
|
|
24
26
|
|
|
27
|
+
通用命中、隔离和失效项适用于所选平台线;下述 `failure-mode`、区域策略、`empty-key-eviction` 与 JetCache 场景核验的是当前 Boot 3 / Java 17 组件。Boot 2 的对应行为按其源码和实际配置另行验证。
|
|
28
|
+
|
|
25
29
|
- 首次调用执行业务,第二次相同 key 命中缓存。
|
|
26
30
|
- 不同租户/业务 key 不串值。
|
|
27
31
|
- 更新、删除、状态变更后旧值失效。
|
|
28
32
|
- `condition`、`unless` 和异常返回行为符合预期。
|
|
29
33
|
- 默认 TTL 和枚举覆盖 TTL 在后端物理存在。
|
|
30
|
-
- Redis
|
|
34
|
+
- Redis 故障时 fail-fast、bypass、fallback 的查询与显式写行为分别符合配置;恢复时脏 Redis 区域必须失效,失效失败不得切回。
|
|
35
|
+
- 区域 TTL/容量/空值策略按实际后端生效;`SimpleKey.EMPTY` 在 legacy-clear 与 evict 下分别执行清区与单 key 删除。
|
|
36
|
+
- JetCache 分别验证包装器与原生 `QuickConfig`:包装器即使配置广播频道也不自动同步本地失效;原生 `BOTH + syncLocal(true)` 在频道、相同 area/name 和订阅生效后,用两个独立 JVM 验证更新、删除与未订阅时的旧值边界;第二次创建不改变首次缓存配置。
|
|
31
37
|
- Sentinel/Cluster 创建正确连接工厂,Cluster 使用 DB 0。
|
|
32
38
|
- Docker 可用时真实 Redis 认证、JSON template、JDK cache serialization 和 TTL 测试实际执行。
|
|
33
|
-
- Java 8
|
|
39
|
+
- 所选 Boot 2 / Java 8 源码 class major 为 52;Boot 3 / Java 17 为 61。两条平台线分别使用匹配的源码根运行脚本,Docker 不可用时单独报告真实 Redis 集成测试未执行。
|
|
34
40
|
- `git diff --check` 通过,消费 starter 构建通过。
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -u
|
|
3
3
|
|
|
4
|
+
platform_line=""
|
|
4
5
|
source_root=""
|
|
5
6
|
consumer_root=""
|
|
6
7
|
consumer_module=""
|
|
7
8
|
|
|
8
9
|
usage() {
|
|
9
|
-
echo "Usage: $0 [--source-root PATH] [--consumer-root PATH --consumer-module MODULE]" >&2
|
|
10
|
+
echo "Usage: $0 --platform-line <boot2-java8|boot3-java17> [--source-root PATH] [--consumer-root PATH --consumer-module MODULE]" >&2
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
while [ "$#" -gt 0 ]; do
|
|
13
14
|
case "$1" in
|
|
15
|
+
--platform-line) [ "$#" -ge 2 ] || { usage; exit 2; }; platform_line=$2; shift 2 ;;
|
|
14
16
|
--source-root) [ "$#" -ge 2 ] || { usage; exit 2; }; source_root=$2; shift 2 ;;
|
|
15
17
|
--consumer-root) [ "$#" -ge 2 ] || { usage; exit 2; }; consumer_root=$2; shift 2 ;;
|
|
16
18
|
--consumer-module) [ "$#" -ge 2 ] || { usage; exit 2; }; consumer_module=$2; shift 2 ;;
|
|
@@ -19,21 +21,19 @@ while [ "$#" -gt 0 ]; do
|
|
|
19
21
|
esac
|
|
20
22
|
done
|
|
21
23
|
|
|
24
|
+
case "$platform_line" in
|
|
25
|
+
boot2-java8) expected_major=52; configured_root=${YSS_SOURCE_ROOT_BOOT2_JAVA8:-} ;;
|
|
26
|
+
boot3-java17) expected_major=61; configured_root=${YSS_SOURCE_ROOT_BOOT3_JAVA17:-} ;;
|
|
27
|
+
*) usage; exit 2 ;;
|
|
28
|
+
esac
|
|
29
|
+
|
|
22
30
|
if [ -z "$source_root" ]; then
|
|
23
|
-
source_root=$
|
|
24
|
-
fi
|
|
25
|
-
if [ -z "$source_root" ]; then
|
|
26
|
-
for candidate in "$PWD" "$PWD/.." "$HOME/Projects/yss-cloud-microservice" "$HOME/Documents/yss-project/yss-cloud-microservice"; do
|
|
27
|
-
if [ -d "$candidate/yss-microservice-components/yss-component-cache-parent" ]; then
|
|
28
|
-
source_root=$candidate
|
|
29
|
-
break
|
|
30
|
-
fi
|
|
31
|
-
done
|
|
31
|
+
source_root=$configured_root
|
|
32
32
|
fi
|
|
33
33
|
|
|
34
34
|
parent="${source_root%/}/yss-microservice-components/yss-component-cache-parent"
|
|
35
35
|
if [ -z "$source_root" ] || [ ! -f "$parent/pom.xml" ]; then
|
|
36
|
-
echo "ERROR: cannot locate cache parent; use --source-root or YSS_SOURCE_ROOT" >&2
|
|
36
|
+
echo "ERROR: cannot locate cache parent for $platform_line; use --source-root or its generation-specific YSS_SOURCE_ROOT variable" >&2
|
|
37
37
|
exit 2
|
|
38
38
|
fi
|
|
39
39
|
if [ ! -x "$source_root/mvnw" ]; then
|
|
@@ -46,7 +46,7 @@ if { [ -n "$consumer_root" ] && [ -z "$consumer_module" ]; } || { [ -z "$consume
|
|
|
46
46
|
fi
|
|
47
47
|
|
|
48
48
|
echo "== Cache reactor verify =="
|
|
49
|
-
(cd "$source_root" && ./mvnw -f "$parent/pom.xml" verify) || exit 1
|
|
49
|
+
(cd "$source_root" && ./mvnw -f "$parent/pom.xml" clean verify) || exit 1
|
|
50
50
|
|
|
51
51
|
echo "== Docker integration status =="
|
|
52
52
|
report="$parent/yss-component-redis-cache/target/surefire-reports/TEST-com.yss.cloud.cache.redis.config.RedisStandaloneIntegrationTest.xml"
|
|
@@ -66,14 +66,14 @@ fi
|
|
|
66
66
|
|
|
67
67
|
echo "== Diff whitespace =="
|
|
68
68
|
if command -v git >/dev/null 2>&1 && git -C "$source_root" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
69
|
-
git -C "$source_root" diff --check || exit 1
|
|
69
|
+
git -C "$source_root" diff --check -- yss-microservice-components/yss-component-cache-parent || exit 1
|
|
70
70
|
else
|
|
71
71
|
echo "SKIP: source root is not a Git worktree"
|
|
72
72
|
fi
|
|
73
73
|
|
|
74
|
-
echo "==
|
|
75
|
-
|
|
76
|
-
if [
|
|
74
|
+
echo "== $platform_line bytecode (major $expected_major) =="
|
|
75
|
+
class_count=$(find "$parent" -path '*/target/classes/*.class' -type f | wc -l | tr -d ' ')
|
|
76
|
+
if [ "$class_count" -eq 0 ]; then
|
|
77
77
|
echo "ERROR: no compiled cache class found" >&2
|
|
78
78
|
exit 1
|
|
79
79
|
fi
|
|
@@ -81,12 +81,18 @@ if ! command -v javap >/dev/null 2>&1; then
|
|
|
81
81
|
echo "ERROR: javap is required for bytecode verification" >&2
|
|
82
82
|
exit 2
|
|
83
83
|
fi
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
major_lines=$(find "$parent" -path '*/target/classes/*.class' -type f -exec javap -verbose {} \; 2>/dev/null | sed -n 's/.*major version: *//p')
|
|
85
|
+
checked_count=$(printf '%s\n' "$major_lines" | sed '/^$/d' | wc -l | tr -d ' ')
|
|
86
|
+
if [ "$checked_count" -ne "$class_count" ]; then
|
|
87
|
+
echo "ERROR: javap inspected $checked_count of $class_count compiled cache classes" >&2
|
|
88
|
+
exit 1
|
|
89
|
+
fi
|
|
90
|
+
majors=$(printf '%s\n' "$major_lines" | sort -u)
|
|
91
|
+
if [ "$majors" != "$expected_major" ]; then
|
|
92
|
+
echo "ERROR: expected only $platform_line major version $expected_major, found: $majors" >&2
|
|
87
93
|
exit 1
|
|
88
94
|
fi
|
|
89
|
-
echo "PASS: all cache classes use major version
|
|
95
|
+
echo "PASS: all cache classes use major version $expected_major"
|
|
90
96
|
|
|
91
97
|
if [ -n "$consumer_root" ]; then
|
|
92
98
|
echo "== Consumer build =="
|
|
@@ -1,72 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yss-distributed-id
|
|
3
|
-
description: "接入或排查 YSS 分布式 ID
|
|
3
|
+
description: "接入或排查 YSS 分布式 ID 的 Segment、Snowflake、主键注入与迁移;旧 CosId/远程调用仅按既有平台线分诊。"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# yss-distributed-id
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
处理 `yss-component-distributed-id` 及 Leaf 消费项目的发号、主键填充与迁移。先从批准的 `platform_configuration.component_platform_line` 选择 [源码索引](references/source-index.md);Boot 2 的历史能力不能推定为 Boot 3 可用能力。无批准合同的既有工程故障可只读分诊,不据此改策略或宣布兼容。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 接入决策
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
1. 核对实际组件 GAV、平台线、依赖树及当前源码,再确定已有主键策略、注入模式和数据库约束。保持既有 Long 主键及调用方类型,策略变更单独评估数据和 API 影响。
|
|
13
|
+
2. Boot 3 的数值分布式发号使用本地 Leaf Segment / Snowflake;拦截器仍有 String UUID 分支,但它不是数值发号方案。CosId、Feign/远程注入及旧注解参数是迁移分诊线索,不作为新接入选项;Boot 2 维护以其独立源码索引为准。
|
|
14
|
+
3. Boot 3 默认 `local + Segment`:引入组件后核对 DataSource、JDBC 驱动、目标方言建表脚本及 `leaf_alloc`。不发号的应用应显式关闭注入及 Segment;选 Snowflake 时显式启用 Snowflake、关闭 Segment,并验证 worker-id 唯一、时钟回拨处理和节点重启行为。`local` 注入须且只能启用一种算法,不要把 ZooKeeper 当作当前 Snowflake 的默认依赖。
|
|
15
|
+
4. Segment 缺失标签策略、声明、step 和初始水位必须与真实业务表及既有分配记录一致。自动建标签不建表、也不读取业务表最大 ID;迁移前固定停写/切换边界,起点不得低于已分配号段上界,不重置 `leaf_alloc`。
|
|
16
|
+
5. 主键填充同时核对实体注解、插入方法和参数形态。`IdType.AUTO` 保留数据库自增;`ASSIGN_ID` 或显式 Segment/Snowflake 才走组件发号。已有非零值应保留;生成值与 `Long`、十进制 `String`、`Integer` 的转换及溢出必须验证,不能只凭注解推断批量入口已被拦截。
|
|
15
17
|
|
|
16
|
-
##
|
|
18
|
+
## 排障与验证
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
- 启动失败:按自动配置、注入模式、算法开关、DataSource、`leaf_alloc`、方言顺序定位。`disabled` 仅关闭自动注入;完全不用 Segment 时还须核对其算法开关。
|
|
21
|
+
- 重号/错号:核对跨服务业务 tag、控制表唯一键、当前水位、历史号段、Snowflake worker-id 与时钟;先保留现场,不用重建表或清空控制记录排障。
|
|
22
|
+
- 插入缺 ID:核对 `TableId`/生成策略、实体字段类型、当前公开批量方法及 MyBatis 参数包装是否经过拦截器;再检查消费者自定义 `IdentifierGenerator` 是否接管。
|
|
23
|
+
- 行为修改使用组件父 reactor 的根 `./mvnw` 验证启动、单条/批量主键、迁移边界和目标数据库方言;H2 不能证明生产方言。只读故障分诊与已执行验证分别记录。
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- 源码位置不要假设固定目录;先按 `yss-skill-source-index-refresh/references/source-location.md` 定位。
|
|
26
|
-
- 当前技能索引:`references/source-index.md`
|
|
27
|
-
- 重点源码入口通常包括 `EnableDistributedId`、`AutoIdInterceptor`、Leaf 配置、Leaf REST/Feign/gRPC 模块、ID 策略相关类。
|
|
28
|
-
|
|
29
|
-
当组件源码变化后,用 `yss-skill-source-index-refresh` 刷新索引;刷新或读取前先按源码定位策略确认真实位置。
|
|
30
|
-
|
|
31
|
-
## 检查清单
|
|
32
|
-
|
|
33
|
-
- 启动类是否启用了分布式 ID 能力。
|
|
34
|
-
- 当前策略是否与部署条件匹配。
|
|
35
|
-
- 批量插入链路是否会经过拦截器。
|
|
36
|
-
- 实体主键类型与生成策略是否兼容。
|
|
37
|
-
- Leaf Segment 场景下 `leaf_alloc` 是否已初始化。
|
|
38
|
-
- MyBatis/MyBatis-Plus 的插入方法是否绕过了自动 ID 拦截逻辑。
|
|
39
|
-
- 多服务共享号段时,业务 tag/key 是否唯一且稳定。
|
|
40
|
-
|
|
41
|
-
## 策略建议
|
|
42
|
-
|
|
43
|
-
- 追求稳定和趋势递增时,优先 Leaf Segment。
|
|
44
|
-
- 依赖 ZooKeeper 且要求高吞吐时,可考虑 Snowflake。
|
|
45
|
-
- 若项目已有 CosId 统一方案,沿用现有生态。
|
|
46
|
-
- 除非业务明确允许,否则不要把 Long 主键切到 String UUID。
|
|
47
|
-
|
|
48
|
-
## 修改约束
|
|
49
|
-
|
|
50
|
-
- 不要混用多种主键生成策略而不说明边界。
|
|
51
|
-
- 不要仅改实体注解而忽略底层配置和依赖。
|
|
52
|
-
- 如果用户只是在做普通 MyBatis-Plus 主键配置,不要过度引入新组件。
|
|
53
|
-
- 不要在已有 Long 主键生态里随意改成 String UUID,除非调用方和数据库约束都确认兼容。
|
|
54
|
-
|
|
55
|
-
## 排障顺序
|
|
56
|
-
|
|
57
|
-
1. 确认启用注解和 starter 依赖。
|
|
58
|
-
2. 确认实体主键类型、注解和插入方法。
|
|
59
|
-
3. 确认拦截器是否参与 MyBatis 调用链。
|
|
60
|
-
4. Leaf 场景确认服务、号段表和业务 key。
|
|
61
|
-
5. Snowflake/CosId 场景确认机器号、时钟、注册中心或 worker 分配。
|
|
62
|
-
6. 批量插入失败时确认是否调用了项目推荐批量方法。
|
|
63
|
-
|
|
64
|
-
## 按需读取
|
|
65
|
-
|
|
66
|
-
- 源码索引:`references/source-index.md`
|
|
67
|
-
- 拦截器与自动注入:`assets/AutoIdInterceptor.java`
|
|
68
|
-
- 启用注解:`assets/EnableDistributedId.java`
|
|
69
|
-
- Leaf 配置相关:`assets/LeafConf.java`
|
|
25
|
+
当前源码入口与平台差异见 [能力与迁移说明](references/README.md)。不要从 Skill 的历史示例或旧资产复制生产源码;精确类名、配置和默认值以选定平台线的当前源码为准。
|
|
70
26
|
|
|
71
27
|
## 平台与源码门禁
|
|
72
28
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
version: 1
|
|
2
2
|
interface:
|
|
3
3
|
display_name: "YSS Distributed ID"
|
|
4
|
-
short_description: "Leaf、
|
|
5
|
-
default_prompt: "Use $yss-distributed-id to configure or debug
|
|
4
|
+
short_description: "Leaf Segment、Snowflake 与主键注入排障"
|
|
5
|
+
default_prompt: "Use $yss-distributed-id to configure or debug platform-bound Leaf Segment, Snowflake, and MyBatis ID injection; treat CosId and remote modes as legacy migration cases."
|
|
@@ -1,51 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 分布式 ID 能力与迁移说明
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本文件只说明选择和核验边界。类名、配置默认值及方法签名以所选平台线的生成索引和匹配的干净源码为准,不复制组件实现。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
| 场景 | Boot 3 / Java 17 当前工作树观察 | 核验重点 |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| Segment | 本地号段;默认 local + Segment | DataSource、目标方言建表、`biz_tag` 唯一键、已分配水位、缺失标签策略 |
|
|
8
|
+
| Snowflake | 本地节点发号;可配置 worker-id,未指定时按节点地址派生 | 所有实例 worker-id 无冲突、时钟回拨和序列等待;不假设 ZooKeeper 注册 |
|
|
9
|
+
| 主键自动填充 | MyBatis 拦截与 MyBatis-Plus `IdentifierGenerator` 两条入口 | `AUTO` 与 `ASSIGN_ID` 区分、已有值保留、批量参数形态、`Integer` 溢出 |
|
|
10
|
+
| String UUID | 本地拦截器仍有 UUID 字符串分支 | 仅核对显式 UUID 策略及 String 字段,不当作 Segment/Snowflake 的数值主键迁移替代 |
|
|
11
|
+
| CosId、Feign/远程注入 | 当前 Boot 3 主线不提供 | 仅对既有项目按其实际平台线和源码做迁移分诊,不把旧模块写成新接入依赖 |
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
**位置**: `../assets/AutoIdInterceptor.java`
|
|
13
|
+
Segment 从现有业务表接管 ID 时,先记录业务表最大值、`leaf_alloc.max_id` 和尚未用尽的已分配号段,再在停写窗口确定不回退的起点。缺失标签自动创建不会计算这些值;不得删除或重置控制记录。Snowflake 切换需验证新旧机器位语义及所有活跃节点,不在混合写流量时直接换算法。遗留 `feign_segment` 注解仍是明确的拒绝路径,迁移须清理旧注解及依赖,不能用已有非零 ID 掩盖它。
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**拦截逻辑**:
|
|
13
|
-
- **拦截点**: `StatementHandler.prepare` 方法。
|
|
14
|
-
- **判断条件**: 仅拦截 `INSERT` 语句。
|
|
15
|
-
- **处理流程**:
|
|
16
|
-
1. 获取 SQL 绑定的参数对象 (`parameterObject`)。
|
|
17
|
-
2. 支持处理单对象、`List`、`Array` 和 `Map` (MyBatis 多参数封装)。
|
|
18
|
-
3. 遍历参数对象的实体类,检查是否有 `@Entity` (JPA) 或 `@TableName` (MP) 注解。
|
|
19
|
-
4. 扫描实体字段,查找 `@GeneratedValue` 或 `@TableId` 注解。
|
|
20
|
-
5. 根据注解指定的策略 (`segment`, `snowflake`, `cosid_segment` 等),调用对应的 ID 生成器获取 ID。
|
|
21
|
-
6. 通过反射将 ID 设置到实体的相应字段中。
|
|
22
|
-
|
|
23
|
-
### 2. EnableDistributedId.java
|
|
24
|
-
**位置**: `../assets/EnableDistributedId.java`
|
|
25
|
-
|
|
26
|
-
开启分布式 ID 功能的注解。
|
|
27
|
-
|
|
28
|
-
**属性**:
|
|
29
|
-
- `autoRegister`: 是否自动注册配置,默认为 `true`。
|
|
30
|
-
- `cosid`: 是否开启 CosId 模式,默认为 `false` (即默认使用 Leaf 模式)。
|
|
31
|
-
|
|
32
|
-
**作用**:
|
|
33
|
-
- 导入 `LeafDataSourceConfiguration` 和 `EnableDistributedImportSelector`,从而根据配置加载相应的 Bean。
|
|
34
|
-
|
|
35
|
-
### 3. LeafConf.java
|
|
36
|
-
**位置**: `../assets/LeafConf.java`
|
|
37
|
-
|
|
38
|
-
Leaf 模式的配置类,对应 `spring.leaf` 配置项。
|
|
39
|
-
|
|
40
|
-
**属性**:
|
|
41
|
-
- `leafSegmentEnable`: 是否开启号段模式。
|
|
42
|
-
- `leafSnowflakeEnable`: 是否开启雪花算法模式。
|
|
43
|
-
|
|
44
|
-
## ID 生成策略详解
|
|
45
|
-
|
|
46
|
-
| 策略名称 | 依赖组件 | 描述 | 适用场景 |
|
|
47
|
-
| :--- | :--- | :--- | :--- |
|
|
48
|
-
| **Leaf Segment** | DB (MySQL) | 基于数据库号段,每次从 DB 获取一个号段到内存,高性能,ID 趋势递增。 | 大多数业务场景,高可用要求高。 |
|
|
49
|
-
| **Leaf Snowflake** | Zookeeper | 基于 Twitter 雪花算法,依赖 ZK 进行 WorkerID 管理。 | 对 ID 生成速度要求极高,且不依赖 DB 的场景。 |
|
|
50
|
-
| **CosId Segment** | DB (MySQL) | CosId 的号段模式实现,支持更丰富的配置(如步长动态调整)。 | 需要 CosId 特性或作为 Leaf 的替代方案。 |
|
|
51
|
-
| **UUID** | JDK | 标准 UUID。 | 无需有序、不关心存储空间的场景。 |
|
|
15
|
+
只读分诊可参考当前组件 `readme.md` 和源码路径提示;组件子树 dirty、索引 tree 不一致或兼容证据未 verified 时,这些观察不构成精确接入或发布结论。
|
|
@@ -5,6 +5,8 @@ description: "编译或重验 YSS Slice Implementation Contract、最小 Skill
|
|
|
5
5
|
|
|
6
6
|
# YSS Implementation Contract Compiler
|
|
7
7
|
|
|
8
|
+
已有生命周期资产优先用 `scripts/contract view <资产> --kind <类型>` 阅读;执行任务用 `--profile task --unit <ID>`,绑定与校验明细用 `--profile full`。视图不授予执行权限,仍按本 Skill 的原始来源和批准门禁处理。类型、准备和迁移见 `docs/process/contract-reading.md`。
|
|
9
|
+
|
|
8
10
|
阶段 7 的实现合同编译器。它把已批准的生命周期资产、垂直切片、capability 和窄 Recipe 编译为 `Slice Implementation Contract` v3 草案;不批准合同、不写业务代码、不设置 `ready-for-agent`。
|
|
9
11
|
|
|
10
12
|
文档输出时按 `lifecycle-document-output` 条件调用 `i-have-adhd`,读取 `docs/process/document-writing.md`;作用域仅限当前产物,派发时传递条件及引用。
|
|
@@ -33,6 +33,18 @@ description: 用于 YSS MyBatis / MyBatis-Plus 组件能力核验、接入决策
|
|
|
33
33
|
<!-- yss-rule {"id":"mybatis.transaction","when":"mybatis","level":"mandatory","evidence":"code-and-verification"} -->
|
|
34
34
|
- 事务边界归批准的 Application 用例或 MVC service/core;Repository 不临时声明新的业务事务。
|
|
35
35
|
|
|
36
|
+
## 能力选择记录
|
|
37
|
+
|
|
38
|
+
| 既有工程调用 seam | 选择与核验 |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `PageQuery` 经组件切面进入 Repository/Gateway | 核对代理切点、参数位置、PageHelper 开关、实际 SQL 与 `tempTotalCount`;不能因 Bean 注册就认定切面命中。 |
|
|
41
|
+
| Mapper 使用 MyBatis-Plus `IPage` | 核对 MP 分页开关、方言、实际 SQL 与 total;同一次查询不得叠加 PageHelper 上下文。两插件都注册不等于查询已双分页。 |
|
|
42
|
+
| 原生 Mapper/Example/ListMapper | 按当前源码和实体映射选择 `BaseRepository<T,D>`;与完整 MP `BasePlusRepository<T>` 不可直接互换,混用或复合键须验证主键方法、XML 与映射。 |
|
|
43
|
+
| SQL 级批量写入 | 核对公开入口、分片大小、目标方言生成的单批 SQL、审计填充和 ID;多个分片整体回滚由上层用例事务保证。若 batch size 存在进程级可变状态,多 Spring Context 不得据此宣称配置隔离。 |
|
|
44
|
+
| 命名数据源 | Holder 中有多个 DataSource 不证明动态路由;记录实际 Mapper 的 `SqlSessionFactory`/DataSource、主池与自建池所有权,以及事务绑定。 |
|
|
45
|
+
|
|
46
|
+
以上仅对命中的能力记录,不改变两套分页插件的当前默认注册行为;选择由批准 Profile、消费工程配置和运行测试共同证明。
|
|
47
|
+
|
|
36
48
|
## 任务分流
|
|
37
49
|
|
|
38
50
|
| 请求 | 本 Skill 动作 | 后续路由 |
|
|
@@ -48,8 +60,8 @@ description: 用于 YSS MyBatis / MyBatis-Plus 组件能力核验、接入决策
|
|
|
48
60
|
2. 装配与开关:自动配置、条件属性、Mapper 扫描和 XML location 是否真实生效。
|
|
49
61
|
3. 调用 seam:代理是否命中、分页参数位置/类型、分页插件链和 total 回填责任。
|
|
50
62
|
4. 映射:接口签名、XML namespace、resultMap、字段、逻辑删除和主键策略。
|
|
51
|
-
5.
|
|
52
|
-
6.
|
|
63
|
+
5. 批量:是否调用当前公开批量入口、分批与方言是否匹配、是否退化为循环单条;核对 batch size 在多个应用上下文中的作用域。
|
|
64
|
+
6. 数据源:先确认组件只提供了什么,再检查 Mapper 实际绑定的会话工厂、上层路由与事务进入顺序;不得假设存在当前线程数据源上下文。
|
|
53
65
|
7. 最后检查 SQL、绑定参数、数据库方言与执行计划。
|
|
54
66
|
|
|
55
67
|
## Review 输入
|