universal-dev-standards 5.17.0 → 6.0.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/bin/uds.js +13 -135
- package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +13 -4
- package/bundled/ai/standards/accessibility-standards.ai.yaml +1 -1
- package/bundled/ai/standards/ai-response-navigation.ai.yaml +15 -2
- package/bundled/ai/standards/api-design-standards.ai.yaml +27 -4
- package/bundled/ai/standards/behavior-snapshot.ai.yaml +86 -9
- package/bundled/ai/standards/checkin-standards.ai.yaml +2 -2
- package/bundled/ai/standards/code-review.ai.yaml +2 -2
- package/bundled/ai/standards/context-aware-loading.ai.yaml +3 -3
- package/bundled/ai/standards/data-migration-testing.ai.yaml +79 -3
- package/bundled/ai/standards/deprecation-standards.ai.yaml +10 -2
- package/bundled/ai/standards/developer-memory.ai.yaml +4 -3
- package/bundled/ai/standards/flow-based-testing.ai.yaml +2 -2
- package/bundled/ai/standards/forward-derivation-standards.ai.yaml +26 -2
- package/bundled/ai/standards/full-coverage-testing.ai.yaml +34 -2
- package/bundled/ai/standards/git-worktree.ai.yaml +3 -3
- package/bundled/ai/standards/logging.ai.yaml +97 -3
- package/bundled/ai/standards/mock-boundary.ai.yaml +48 -2
- package/bundled/ai/standards/model-provenance.ai.yaml +297 -0
- package/bundled/ai/standards/model-selection.ai.yaml +11 -2
- package/bundled/ai/standards/observability-standards.ai.yaml +10 -0
- package/bundled/ai/standards/performance-standards.ai.yaml +46 -1
- package/bundled/ai/standards/pii-classification.ai.yaml +15 -1
- package/bundled/ai/standards/pipeline-security-gates.ai.yaml +10 -0
- package/bundled/ai/standards/privacy-standards.ai.yaml +2 -2
- package/bundled/ai/standards/project-context-memory.ai.yaml +2 -2
- package/bundled/ai/standards/refactoring-standards.ai.yaml +68 -3
- package/bundled/ai/standards/resource-cost-boundary.ai.yaml +279 -0
- package/bundled/ai/standards/reverse-engineering-standards.ai.yaml +55 -2
- package/bundled/ai/standards/security-testing.ai.yaml +13 -2
- package/bundled/ai/standards/skill-standard-alignment-check.ai.yaml +37 -2
- package/bundled/ai/standards/user-journey-testing.ai.yaml +107 -0
- package/bundled/ai/standards/verification-oracle.ai.yaml +278 -0
- package/bundled/ai/standards/versioning.ai.yaml +32 -38
- package/bundled/core/acceptance-criteria-traceability.md +15 -5
- package/bundled/core/accessibility-standards.md +8 -4
- package/bundled/core/ai-friendly-architecture.md +1 -1
- package/bundled/core/ai-response-navigation.md +31 -3
- package/bundled/core/anti-sycophancy-prompting.md +1 -1
- package/bundled/core/api-design-standards.md +92 -7
- package/bundled/core/audit-trail.md +119 -0
- package/bundled/core/behavior-snapshot.md +94 -7
- package/bundled/core/browser-compatibility-standards.md +15 -2
- package/bundled/core/checkin-standards.md +9 -2
- package/bundled/core/code-review-checklist.md +10 -2
- package/bundled/core/container-image-standards.md +97 -0
- package/bundled/core/context-aware-loading.md +2 -2
- package/bundled/core/cost-budget-test.md +1 -1
- package/bundled/core/cross-flow-regression.md +3 -2
- package/bundled/core/data-contract.md +104 -0
- package/bundled/core/data-migration-testing.md +90 -0
- package/bundled/core/data-pipeline.md +113 -0
- package/bundled/core/deprecation-standards.md +16 -2
- package/bundled/core/developer-memory.md +13 -8
- package/bundled/core/documentation-writing-standards.md +1 -1
- package/bundled/core/error-code-standards.md +4 -3
- package/bundled/core/flaky-test-management.md +1 -1
- package/bundled/core/flow-based-testing.md +3 -3
- package/bundled/core/forward-derivation-standards.md +33 -5
- package/bundled/core/full-coverage-testing.md +72 -0
- package/bundled/core/git-worktree.md +4 -4
- package/bundled/core/guides/performance-guide.md +1 -1
- package/bundled/core/guides/security-guide.md +1 -1
- package/bundled/core/health-check-standards.md +2 -2
- package/bundled/core/iac-design-principles.md +97 -0
- package/bundled/core/incident-response.md +119 -0
- package/bundled/core/license-compliance.md +2 -0
- package/bundled/core/logging-standards.md +78 -2
- package/bundled/core/mock-boundary.md +54 -2
- package/bundled/core/model-provenance.md +181 -0
- package/bundled/core/model-selection.md +27 -2
- package/bundled/core/packaging-standards.md +1 -0
- package/bundled/core/performance-standards.md +96 -2
- package/bundled/core/pii-classification.md +148 -0
- package/bundled/core/pipeline-security-gates.md +22 -2
- package/bundled/core/postmortem-standards.md +2 -0
- package/bundled/core/prd-standards.md +91 -0
- package/bundled/core/privacy-standards.md +14 -3
- package/bundled/core/product-metrics-standards.md +100 -0
- package/bundled/core/project-context-memory.md +8 -2
- package/bundled/core/prompt-regression.md +1 -1
- package/bundled/core/refactoring-standards.md +44 -3
- package/bundled/core/replay-test.md +1 -1
- package/bundled/core/resource-cost-boundary.md +180 -0
- package/bundled/core/reverse-engineering-standards.md +66 -2
- package/bundled/core/runbook.md +113 -0
- package/bundled/core/schema-evolution.md +105 -0
- package/bundled/core/secret-management-standards.md +110 -0
- package/bundled/core/security-testing.md +26 -2
- package/bundled/core/self-review-protocol.md +2 -2
- package/bundled/core/skill-standard-alignment-check.md +53 -0
- package/bundled/core/slo-sli.md +109 -0
- package/bundled/core/smoke-test.md +1 -1
- package/bundled/core/tech-debt-standards.md +1 -1
- package/bundled/core/test-data-standards.md +2 -2
- package/bundled/core/user-journey-testing.md +102 -0
- package/bundled/core/user-story-mapping.md +96 -0
- package/bundled/core/verification-oracle.md +167 -0
- package/bundled/core/versioning.md +133 -109
- package/bundled/locales/COVERAGE.md +84 -73
- package/bundled/locales/zh-CN/CHANGELOG.md +71 -6
- package/bundled/locales/zh-CN/CLAUDE.md +1 -1
- package/bundled/locales/zh-CN/README.md +22 -9
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/adoption/DAILY-WORKFLOW-GUIDE.md +2 -2
- package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +4 -6
- package/bundled/locales/zh-CN/core/accessibility-standards.md +1 -1
- package/bundled/locales/zh-CN/core/adversarial-test.md +226 -0
- package/bundled/locales/zh-CN/core/agent-behavior-discipline.md +187 -0
- package/bundled/locales/zh-CN/core/ai-response-navigation.md +32 -6
- package/bundled/locales/zh-CN/core/anti-sycophancy-prompting.md +1 -1
- package/bundled/locales/zh-CN/core/api-design-standards.md +1 -1
- package/bundled/locales/zh-CN/core/behavior-snapshot.md +335 -0
- package/bundled/locales/zh-CN/core/browser-compatibility-standards.md +229 -0
- package/bundled/locales/zh-CN/core/cd-deployment-strategies.md +135 -0
- package/bundled/locales/zh-CN/core/chaos-injection-tests.md +130 -0
- package/bundled/locales/zh-CN/core/checkin-standards.md +1 -1
- package/bundled/locales/zh-CN/core/code-review-checklist.md +1 -1
- package/bundled/locales/zh-CN/core/container-security.md +535 -0
- package/bundled/locales/zh-CN/core/context-aware-loading.md +1 -1
- package/bundled/locales/zh-CN/core/contract-testing-standards.md +191 -0
- package/bundled/locales/zh-CN/core/cost-budget-test.md +86 -0
- package/bundled/locales/zh-CN/core/cross-flow-regression.md +199 -0
- package/bundled/locales/zh-CN/core/data-migration-testing.md +217 -0
- package/bundled/locales/zh-CN/core/deployment-standards.md +328 -9
- package/bundled/locales/zh-CN/core/deprecation-standards.md +1 -1
- package/bundled/locales/zh-CN/core/developer-memory.md +2 -2
- package/bundled/locales/zh-CN/core/disaster-recovery-drill.md +87 -0
- package/bundled/locales/zh-CN/core/documentation-structure.md +1 -1
- package/bundled/locales/zh-CN/core/documentation-writing-standards.md +1 -1
- package/bundled/locales/zh-CN/core/error-code-standards.md +2 -2
- package/bundled/locales/zh-CN/core/feature-manifest-standard.md +222 -0
- package/bundled/locales/zh-CN/core/flaky-test-management.md +87 -0
- package/bundled/locales/zh-CN/core/flow-based-testing.md +284 -0
- package/bundled/locales/zh-CN/core/forward-derivation-standards.md +3 -4
- package/bundled/locales/zh-CN/core/full-coverage-testing.md +197 -0
- package/bundled/locales/zh-CN/core/git-worktree.md +1 -1
- package/bundled/locales/zh-CN/core/governance-layer.md +160 -0
- package/bundled/locales/zh-CN/core/guides/performance-guide.md +515 -0
- package/bundled/locales/zh-CN/core/guides/security-guide.md +494 -0
- package/bundled/locales/zh-CN/core/knowledge-graph-memory.md +128 -0
- package/bundled/locales/zh-CN/core/license-compliance.md +129 -0
- package/bundled/locales/zh-CN/core/llm-output-validation.md +192 -0
- package/bundled/locales/zh-CN/core/logging-standards.md +130 -8
- package/bundled/locales/zh-CN/core/mock-boundary.md +109 -0
- package/bundled/locales/zh-CN/core/model-selection.md +28 -5
- package/bundled/locales/zh-CN/core/mutation-testing.md +106 -0
- package/bundled/locales/zh-CN/core/no-cicd-deployment.md +219 -0
- package/bundled/locales/zh-CN/core/packaging-standards.md +76 -5
- package/bundled/locales/zh-CN/core/pipeline-security-gates.md +126 -0
- package/bundled/locales/zh-CN/core/policy-as-code-testing.md +203 -0
- package/bundled/locales/zh-CN/core/privacy-standards.md +1 -1
- package/bundled/locales/zh-CN/core/project-context-memory.md +1 -1
- package/bundled/locales/zh-CN/core/prompt-regression.md +88 -0
- package/bundled/locales/zh-CN/core/property-based-testing.md +87 -0
- package/bundled/locales/zh-CN/core/release-quality-manifest.md +207 -0
- package/bundled/locales/zh-CN/core/release-readiness-gate.md +193 -0
- package/bundled/locales/zh-CN/core/replay-test.md +102 -0
- package/bundled/locales/zh-CN/core/reverse-engineering-standards.md +46 -1
- package/bundled/locales/zh-CN/core/rollback-standards.md +120 -0
- package/bundled/locales/zh-CN/core/sast-advanced.md +309 -0
- package/bundled/locales/zh-CN/core/secure-op.md +328 -0
- package/bundled/locales/zh-CN/core/security-testing.md +96 -0
- package/bundled/locales/zh-CN/core/self-review-protocol.md +167 -0
- package/bundled/locales/zh-CN/core/server-ops-security.md +507 -0
- package/bundled/locales/zh-CN/core/smoke-test.md +79 -0
- package/bundled/locales/zh-CN/core/spec-driven-development.md +39 -3
- package/bundled/locales/zh-CN/core/supply-chain-attestation.md +131 -0
- package/bundled/locales/zh-CN/core/versioning.md +1 -1
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +31 -6
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +61 -34
- package/bundled/locales/zh-CN/docs/MIGRATION-v6.md +88 -0
- package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +2 -2
- package/bundled/locales/zh-CN/docs/USER-MANUAL.md +14 -14
- package/bundled/locales/zh-CN/docs/specs/system/memory-adoption-strategy.md +105 -0
- package/bundled/locales/zh-CN/docs/user/FAQ.md +132 -0
- package/bundled/locales/zh-CN/docs/user/GETTING-STARTED.md +144 -0
- package/bundled/locales/zh-CN/docs/user/GLOSSARY.md +178 -0
- package/bundled/locales/zh-CN/docs/user/README.md +70 -0
- package/bundled/locales/zh-CN/docs/user/TROUBLESHOOTING.md +190 -0
- package/bundled/locales/zh-CN/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +1 -1
- package/bundled/locales/zh-CN/integrations/github-copilot/README.md +1 -1
- package/bundled/locales/zh-CN/integrations/github-copilot/skills-mapping.md +3 -3
- package/bundled/locales/zh-CN/integrations/opencode/skills-mapping.md +3 -3
- package/bundled/locales/zh-CN/methodologies/guides/sdd-guide.md +836 -0
- package/bundled/locales/zh-CN/options/changelog/auto-generated.md +166 -0
- package/bundled/locales/zh-CN/options/changelog/keep-a-changelog.md +140 -0
- package/bundled/locales/zh-CN/options/code-review/automated-review.md +214 -0
- package/bundled/locales/zh-CN/options/code-review/pair-programming.md +166 -0
- package/bundled/locales/zh-CN/options/code-review/pr-review.md +167 -0
- package/bundled/locales/zh-CN/options/documentation/api-docs.md +191 -0
- package/bundled/locales/zh-CN/options/documentation/markdown-docs.md +150 -0
- package/bundled/locales/zh-CN/options/documentation/wiki-style.md +131 -0
- package/bundled/locales/zh-CN/options/project-structure/kotlin.md +144 -0
- package/bundled/locales/zh-CN/options/project-structure/php.md +168 -0
- package/bundled/locales/zh-CN/options/project-structure/ruby.md +156 -0
- package/bundled/locales/zh-CN/options/project-structure/rust.md +136 -0
- package/bundled/locales/zh-CN/options/project-structure/swift.md +165 -0
- package/bundled/locales/zh-CN/options/testing/contract-testing.md +237 -0
- package/bundled/locales/zh-CN/options/testing/industry-pyramid.md +200 -0
- package/bundled/locales/zh-CN/options/testing/istqb-framework.md +144 -0
- package/bundled/locales/zh-CN/options/testing/performance-testing.md +251 -0
- package/bundled/locales/zh-CN/options/testing/security-testing.md +192 -0
- package/bundled/locales/zh-CN/skills/README.md +89 -126
- package/bundled/locales/zh-CN/skills/ac-coverage/SKILL.md +5 -7
- package/bundled/locales/zh-CN/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/agents/code-architect.md +263 -0
- package/bundled/locales/zh-CN/skills/agents/doc-writer.md +410 -0
- package/bundled/locales/zh-CN/skills/agents/reviewer.md +357 -0
- package/bundled/locales/zh-CN/skills/agents/spec-analyst.md +410 -0
- package/bundled/locales/zh-CN/skills/agents/test-specialist.md +368 -0
- package/bundled/locales/zh-CN/skills/ai-collaboration-standards/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/ai-friendly-architecture/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/ai-instruction-standards/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/atdd-assistant/acceptance-criteria-guide.md +1 -1
- package/bundled/locales/zh-CN/skills/atdd-assistant/atdd-workflow.md +3 -4
- package/bundled/locales/zh-CN/skills/audit-assistant/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/bdd-assistant/guide.md +1 -2
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +109 -13
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +30 -8
- package/bundled/locales/zh-CN/skills/checkin-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/ci-cd-assistant/SKILL.md +50 -0
- package/bundled/locales/zh-CN/skills/code-review-assistant/SKILL.md +5 -5
- package/bundled/locales/zh-CN/skills/commands/ac-coverage.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/atdd.md +3 -3
- package/bundled/locales/zh-CN/skills/commands/bdd.md +2 -2
- package/bundled/locales/zh-CN/skills/commands/brainstorm.md +26 -17
- package/bundled/locales/zh-CN/skills/commands/{review.md → code-review.md} +4 -4
- package/bundled/locales/zh-CN/skills/commands/derive-all.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/derive-atdd.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/derive-bdd.md +2 -3
- package/bundled/locales/zh-CN/skills/commands/derive-tdd.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/derive.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/dev-workflow.md +2 -2
- package/bundled/locales/zh-CN/skills/commands/methodology.md +4 -4
- package/bundled/locales/zh-CN/skills/commands/pr.md +1 -1
- package/bundled/locales/zh-CN/skills/commands/tdd.md +1 -1
- package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/dev-methodology/create-methodology.md +456 -0
- package/bundled/locales/zh-CN/skills/dev-methodology/guide.md +6 -6
- package/bundled/locales/zh-CN/skills/dev-methodology/runtime.md +296 -0
- package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +5 -5
- package/bundled/locales/zh-CN/skills/docs-generator/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/e2e-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/incident-response-assistant/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/journey-test-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/logging-guide/SKILL.md +146 -142
- package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/observability-assistant/guide.md +1 -1
- package/bundled/locales/zh-CN/skills/pr-automation-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/project-discovery/guide.md +2 -2
- package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/runbook-assistant/guide.md +1 -1
- package/bundled/locales/zh-CN/skills/security-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/skill-builder/SKILL.md +3 -3
- package/bundled/locales/zh-CN/skills/slo-assistant/guide.md +1 -1
- package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/spec-derivation/guide.md +8 -9
- package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/sweep/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/tdd-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-CN/skills/testing-guide/SKILL.md +2 -2
- package/bundled/locales/zh-CN/skills/testing-guide/testing-theory.md +2298 -0
- package/bundled/locales/zh-CN/skills/workflows/README.md +451 -0
- package/bundled/locales/zh-TW/CHANGELOG.md +71 -6
- package/bundled/locales/zh-TW/CLAUDE.md +1 -1
- package/bundled/locales/zh-TW/MAINTENANCE.md +25 -2
- package/bundled/locales/zh-TW/README.md +22 -9
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/adoption/DAILY-WORKFLOW-GUIDE.md +2 -2
- package/bundled/locales/zh-TW/ai/standards/versioning.ai.yaml +8 -48
- package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +4 -6
- package/bundled/locales/zh-TW/core/accessibility-standards.md +1 -1
- package/bundled/locales/zh-TW/core/adversarial-test.md +226 -0
- package/bundled/locales/zh-TW/core/agent-behavior-discipline.md +187 -0
- package/bundled/locales/zh-TW/core/ai-response-navigation.md +32 -6
- package/bundled/locales/zh-TW/core/anti-sycophancy-prompting.md +1 -1
- package/bundled/locales/zh-TW/core/api-design-standards.md +91 -9
- package/bundled/locales/zh-TW/core/audit-trail.md +110 -0
- package/bundled/locales/zh-TW/core/behavior-snapshot.md +335 -0
- package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +1 -0
- package/bundled/locales/zh-TW/core/cd-deployment-strategies.md +135 -0
- package/bundled/locales/zh-TW/core/chaos-injection-tests.md +130 -0
- package/bundled/locales/zh-TW/core/checkin-standards.md +1 -1
- package/bundled/locales/zh-TW/core/code-review-checklist.md +1 -1
- package/bundled/locales/zh-TW/core/container-image-standards.md +93 -0
- package/bundled/locales/zh-TW/core/container-security.md +535 -0
- package/bundled/locales/zh-TW/core/cost-budget-test.md +86 -0
- package/bundled/locales/zh-TW/core/cross-flow-regression.md +1 -0
- package/bundled/locales/zh-TW/core/data-contract.md +101 -0
- package/bundled/locales/zh-TW/core/data-migration-testing.md +217 -0
- package/bundled/locales/zh-TW/core/data-pipeline.md +105 -0
- package/bundled/locales/zh-TW/core/deployment-standards.md +363 -25
- package/bundled/locales/zh-TW/core/deprecation-standards.md +17 -4
- package/bundled/locales/zh-TW/core/developer-memory.md +2 -2
- package/bundled/locales/zh-TW/core/disaster-recovery-drill.md +87 -0
- package/bundled/locales/zh-TW/core/documentation-writing-standards.md +1 -1
- package/bundled/locales/zh-TW/core/error-code-standards.md +2 -2
- package/bundled/locales/zh-TW/core/feature-manifest-standard.md +222 -0
- package/bundled/locales/zh-TW/core/flaky-test-management.md +87 -0
- package/bundled/locales/zh-TW/core/flow-based-testing.md +284 -0
- package/bundled/locales/zh-TW/core/forward-derivation-standards.md +3 -4
- package/bundled/locales/zh-TW/core/full-coverage-testing.md +250 -0
- package/bundled/locales/zh-TW/core/git-worktree.md +1 -1
- package/bundled/locales/zh-TW/core/guides/performance-guide.md +515 -0
- package/bundled/locales/zh-TW/core/guides/security-guide.md +494 -0
- package/bundled/locales/zh-TW/core/iac-design-principles.md +90 -0
- package/bundled/locales/zh-TW/core/incident-response.md +111 -0
- package/bundled/locales/zh-TW/core/license-compliance.md +129 -0
- package/bundled/locales/zh-TW/core/llm-output-validation.md +192 -0
- package/bundled/locales/zh-TW/core/logging-standards.md +208 -4
- package/bundled/locales/zh-TW/core/mock-boundary.md +161 -0
- package/bundled/locales/zh-TW/core/model-provenance.md +173 -0
- package/bundled/locales/zh-TW/core/model-selection.md +28 -5
- package/bundled/locales/zh-TW/core/mutation-testing.md +106 -0
- package/bundled/locales/zh-TW/core/no-cicd-deployment.md +219 -0
- package/bundled/locales/zh-TW/core/packaging-standards.md +76 -5
- package/bundled/locales/zh-TW/core/performance-standards.md +84 -5
- package/bundled/locales/zh-TW/core/pii-classification.md +102 -0
- package/bundled/locales/zh-TW/core/pipeline-security-gates.md +126 -0
- package/bundled/locales/zh-TW/core/policy-as-code-testing.md +203 -0
- package/bundled/locales/zh-TW/core/prd-standards.md +88 -0
- package/bundled/locales/zh-TW/core/privacy-standards.md +1 -1
- package/bundled/locales/zh-TW/core/product-metrics-standards.md +96 -0
- package/bundled/locales/zh-TW/core/project-context-memory.md +1 -1
- package/bundled/locales/zh-TW/core/prompt-regression.md +88 -0
- package/bundled/locales/zh-TW/core/property-based-testing.md +87 -0
- package/bundled/locales/zh-TW/core/refactoring-standards.md +43 -6
- package/bundled/locales/zh-TW/core/release-quality-manifest.md +207 -0
- package/bundled/locales/zh-TW/core/replay-test.md +102 -0
- package/bundled/locales/zh-TW/core/resource-cost-boundary.md +175 -0
- package/bundled/locales/zh-TW/core/reverse-engineering-standards.md +64 -5
- package/bundled/locales/zh-TW/core/rollback-standards.md +120 -0
- package/bundled/locales/zh-TW/core/runbook.md +110 -0
- package/bundled/locales/zh-TW/core/sast-advanced.md +309 -0
- package/bundled/locales/zh-TW/core/schema-evolution.md +98 -0
- package/bundled/locales/zh-TW/core/secret-management-standards.md +101 -0
- package/bundled/locales/zh-TW/core/secure-op.md +328 -0
- package/bundled/locales/zh-TW/core/security-testing.md +96 -0
- package/bundled/locales/zh-TW/core/self-review-protocol.md +2 -2
- package/bundled/locales/zh-TW/core/server-ops-security.md +507 -0
- package/bundled/locales/zh-TW/core/slo-sli.md +108 -0
- package/bundled/locales/zh-TW/core/smoke-test.md +79 -0
- package/bundled/locales/zh-TW/core/spec-driven-development.md +19 -11
- package/bundled/locales/zh-TW/core/supply-chain-attestation.md +131 -0
- package/bundled/locales/zh-TW/core/user-journey-testing.md +111 -0
- package/bundled/locales/zh-TW/core/user-story-mapping.md +94 -0
- package/bundled/locales/zh-TW/core/verification-oracle.md +159 -0
- package/bundled/locales/zh-TW/core/versioning.md +112 -112
- package/bundled/locales/zh-TW/docs/CHEATSHEET.md +31 -6
- package/bundled/locales/zh-TW/docs/DEV-WORKFLOW-MAPPING.md +6 -6
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +61 -34
- package/bundled/locales/zh-TW/docs/MIGRATION-v6.md +88 -0
- package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +2 -2
- package/bundled/locales/zh-TW/docs/USER-MANUAL.md +14 -14
- package/bundled/locales/zh-TW/docs/specs/system/memory-adoption-strategy.md +105 -0
- package/bundled/locales/zh-TW/docs/user/FAQ.md +132 -0
- package/bundled/locales/zh-TW/docs/user/GETTING-STARTED.md +144 -0
- package/bundled/locales/zh-TW/docs/user/GLOSSARY.md +178 -0
- package/bundled/locales/zh-TW/docs/user/README.md +70 -0
- package/bundled/locales/zh-TW/docs/user/TROUBLESHOOTING.md +190 -0
- package/bundled/locales/zh-TW/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +1 -1
- package/bundled/locales/zh-TW/integrations/github-copilot/README.md +1 -1
- package/bundled/locales/zh-TW/integrations/github-copilot/skills-mapping.md +3 -3
- package/bundled/locales/zh-TW/integrations/opencode/skills-mapping.md +3 -3
- package/bundled/locales/zh-TW/methodologies/guides/sdd-guide.md +523 -26
- package/bundled/locales/zh-TW/options/changelog/auto-generated.md +166 -0
- package/bundled/locales/zh-TW/options/changelog/keep-a-changelog.md +140 -0
- package/bundled/locales/zh-TW/options/code-review/automated-review.md +214 -0
- package/bundled/locales/zh-TW/options/code-review/pair-programming.md +166 -0
- package/bundled/locales/zh-TW/options/code-review/pr-review.md +167 -0
- package/bundled/locales/zh-TW/options/documentation/api-docs.md +191 -0
- package/bundled/locales/zh-TW/options/documentation/markdown-docs.md +150 -0
- package/bundled/locales/zh-TW/options/documentation/wiki-style.md +131 -0
- package/bundled/locales/zh-TW/options/project-structure/kotlin.md +144 -0
- package/bundled/locales/zh-TW/options/project-structure/php.md +168 -0
- package/bundled/locales/zh-TW/options/project-structure/ruby.md +156 -0
- package/bundled/locales/zh-TW/options/project-structure/rust.md +136 -0
- package/bundled/locales/zh-TW/options/project-structure/swift.md +165 -0
- package/bundled/locales/zh-TW/options/testing/contract-testing.md +237 -0
- package/bundled/locales/zh-TW/options/testing/industry-pyramid.md +200 -0
- package/bundled/locales/zh-TW/options/testing/istqb-framework.md +144 -0
- package/bundled/locales/zh-TW/options/testing/performance-testing.md +251 -0
- package/bundled/locales/zh-TW/options/testing/security-testing.md +192 -0
- package/bundled/locales/zh-TW/skills/README.md +91 -128
- package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +4 -6
- package/bundled/locales/zh-TW/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/agents/code-architect.md +263 -0
- package/bundled/locales/zh-TW/skills/agents/doc-writer.md +410 -0
- package/bundled/locales/zh-TW/skills/agents/reviewer.md +357 -0
- package/bundled/locales/zh-TW/skills/agents/spec-analyst.md +410 -0
- package/bundled/locales/zh-TW/skills/agents/test-specialist.md +368 -0
- package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/atdd-assistant/acceptance-criteria-guide.md +1 -1
- package/bundled/locales/zh-TW/skills/atdd-assistant/atdd-workflow.md +3 -4
- package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +2 -0
- package/bundled/locales/zh-TW/skills/bdd-assistant/guide.md +1 -2
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +110 -14
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +31 -7
- package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +3 -1
- package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +50 -0
- package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +7 -5
- package/bundled/locales/zh-TW/skills/commands/ac-coverage.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/atdd.md +3 -3
- package/bundled/locales/zh-TW/skills/commands/bdd.md +2 -2
- package/bundled/locales/zh-TW/skills/commands/brainstorm.md +26 -17
- package/bundled/locales/zh-TW/skills/commands/{review.md → code-review.md} +5 -5
- package/bundled/locales/zh-TW/skills/commands/derive-all.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/derive-atdd.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/derive-bdd.md +2 -3
- package/bundled/locales/zh-TW/skills/commands/derive-tdd.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/derive.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/dev-workflow.md +2 -2
- package/bundled/locales/zh-TW/skills/commands/methodology.md +4 -4
- package/bundled/locales/zh-TW/skills/commands/pr.md +1 -1
- package/bundled/locales/zh-TW/skills/commands/tdd.md +1 -1
- package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/dev-methodology/create-methodology.md +456 -0
- package/bundled/locales/zh-TW/skills/dev-methodology/guide.md +5 -5
- package/bundled/locales/zh-TW/skills/dev-methodology/runtime.md +296 -0
- package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +5 -5
- package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/e2e-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/logging-guide/SKILL.md +29 -27
- package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +3 -1
- package/bundled/locales/zh-TW/skills/project-discovery/guide.md +2 -2
- package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/spec-derivation/guide.md +7 -8
- package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/sweep/SKILL.md +1 -1
- package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +3 -1
- package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +2 -2
- package/bundled/locales/zh-TW/skills/testing-guide/testing-theory.md +2298 -0
- package/bundled/locales/zh-TW/skills/workflows/README.md +451 -0
- package/bundled/skills/README.md +1 -1
- package/bundled/skills/ac-coverage/SKILL.md +17 -7
- package/bundled/skills/adr-assistant/SKILL.md +1 -1
- package/bundled/skills/agents/code-architect.md +1 -1
- package/bundled/skills/agents/doc-writer.md +1 -1
- package/bundled/skills/agents/reviewer.md +2 -2
- package/bundled/skills/agents/spec-analyst.md +1 -1
- package/bundled/skills/agents/test-specialist.md +1 -1
- package/bundled/skills/ai-collaboration-standards/SKILL.md +2 -2
- package/bundled/skills/ai-friendly-architecture/SKILL.md +2 -2
- package/bundled/skills/ai-instruction-standards/SKILL.md +1 -1
- package/bundled/skills/atdd-assistant/SKILL.md +7 -0
- package/bundled/skills/atdd-assistant/acceptance-criteria-guide.md +1 -1
- package/bundled/skills/atdd-assistant/atdd-workflow.md +6 -8
- package/bundled/skills/audit-assistant/SKILL.md +2 -2
- package/bundled/skills/bdd-assistant/SKILL.md +7 -0
- package/bundled/skills/bdd-assistant/guide.md +1 -2
- package/bundled/skills/brainstorm-assistant/SKILL.md +133 -11
- package/bundled/skills/brainstorm-assistant/guide.md +33 -5
- package/bundled/skills/checkin-assistant/SKILL.md +8 -1
- package/bundled/skills/ci-cd-assistant/SKILL.md +57 -0
- package/bundled/skills/code-review-assistant/SKILL.md +15 -8
- package/bundled/skills/commands/COMMAND-FAMILY-OVERVIEW.md +2 -2
- package/bundled/skills/commands/COMMAND-INDEX.json +3 -3
- package/bundled/skills/commands/README.md +2 -2
- package/bundled/skills/commands/ac-coverage.md +1 -1
- package/bundled/skills/commands/atdd.md +2 -2
- package/bundled/skills/commands/bdd.md +2 -2
- package/bundled/skills/commands/brainstorm.md +25 -14
- package/bundled/skills/commands/{review.md → code-review.md} +6 -6
- package/bundled/skills/commands/derive-all.md +1 -1
- package/bundled/skills/commands/derive-atdd.md +1 -1
- package/bundled/skills/commands/derive-bdd.md +2 -3
- package/bundled/skills/commands/derive-tdd.md +1 -1
- package/bundled/skills/commands/derive.md +1 -1
- package/bundled/skills/commands/dev-workflow.md +1 -1
- package/bundled/skills/commands/journey-test.md +45 -0
- package/bundled/skills/commands/methodology.md +4 -4
- package/bundled/skills/commands/pr.md +1 -1
- package/bundled/skills/commands/skill-builder.md +42 -0
- package/bundled/skills/commands/tdd.md +1 -1
- package/bundled/skills/dev-methodology/create-methodology.md +1 -1
- package/bundled/skills/dev-methodology/guide.md +1 -1
- package/bundled/skills/dev-methodology/runtime.md +1 -1
- package/bundled/skills/dev-workflow-guide/SKILL.md +3 -3
- package/bundled/skills/dev-workflow-guide/workflow-phases.md +3 -3
- package/bundled/skills/docs-generator/SKILL.md +3 -3
- package/bundled/skills/incident-response-assistant/SKILL.md +2 -2
- package/bundled/skills/logging-guide/SKILL.md +38 -2
- package/bundled/skills/migration-assistant/SKILL.md +226 -0
- package/bundled/skills/observability-assistant/SKILL.md +74 -0
- package/bundled/skills/pr-automation-assistant/SKILL.md +5 -1
- package/bundled/skills/project-discovery/guide.md +2 -2
- package/bundled/skills/push/SKILL.md +1 -1
- package/bundled/skills/release-standards/SKILL.md +19 -5
- package/bundled/skills/security-assistant/SKILL.md +1 -1
- package/bundled/skills/skill-builder/SKILL.md +1 -1
- package/bundled/skills/spec-derivation/guide.md +3 -4
- package/bundled/skills/spec-driven-dev/SKILL.md +2 -2
- package/bundled/skills/sweep/SKILL.md +1 -1
- package/bundled/skills/tdd-assistant/SKILL.md +8 -1
- package/bundled/skills/testing-guide/SKILL.md +1 -1
- package/bundled/skills/testing-guide/testing-theory.md +1 -1
- package/bundled/skills/workflows/README.md +2 -2
- package/package.json +3 -3
- package/src/commands/audit.js +30 -9
- package/src/commands/config.js +33 -2
- package/src/commands/hitl.js +14 -1
- package/src/commands/init.js +110 -58
- package/src/commands/quickstart.js +1 -2
- package/src/commands/release.js +51 -6
- package/src/commands/run-intent.js +9 -0
- package/src/commands/spec-split.js +27 -2
- package/src/commands/update.js +22 -6
- package/src/config/ai-agent-paths.js +3 -1
- package/src/i18n/messages.js +3 -102
- package/src/missions/MissionManager.js +44 -12
- package/src/utils/build-manifest.js +35 -3
- package/src/utils/friction-detector.js +71 -22
- package/src/utils/health-checker.js +29 -2
- package/src/utils/transaction.js +111 -0
- package/src/utils/version-promote.js +16 -0
- package/standards-registry.json +58 -146
- package/bundled/ai/standards/agent-communication-protocol.ai.yaml +0 -42
- package/bundled/ai/standards/agent-dispatch.ai.yaml +0 -42
- package/bundled/ai/standards/branch-completion.ai.yaml +0 -44
- package/bundled/ai/standards/change-batching-standards.ai.yaml +0 -44
- package/bundled/ai/standards/execution-history.ai.yaml +0 -42
- package/bundled/ai/standards/pipeline-integration-standards.ai.yaml +0 -42
- package/bundled/ai/standards/workflow-enforcement.ai.yaml +0 -44
- package/bundled/ai/standards/workflow-state-protocol.ai.yaml +0 -43
- package/src/commands/flow.js +0 -260
- package/src/commands/start.js +0 -372
- package/src/commands/sweep.js +0 -151
- package/src/commands/workflow.js +0 -681
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/no-cicd-deployment.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-10
|
|
6
|
+
source_hash: dbe8c04bf6a4
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# No-CI/CD Deployment Strategy
|
|
11
|
+
|
|
12
|
+
> **Language**: [English](../../../core/no-cicd-deployment.md) | 繁體中文
|
|
13
|
+
|
|
14
|
+
> **補充**: 本文件補充 `deployment-standards.md`,專注於無 CI/CD 平台(GitHub Actions / GitLab CI)環境下的可靠部署設計。
|
|
15
|
+
|
|
16
|
+
## 核心三層架構
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Layer 1: 防止錯誤部署
|
|
20
|
+
└─ set -euo pipefail、版本 tag 強制、deploy.lock
|
|
21
|
+
|
|
22
|
+
Layer 2: 驗證部署正確
|
|
23
|
+
└─ Smoke Test、健康檢查、版本號比對、自動 rollback
|
|
24
|
+
|
|
25
|
+
Layer 3: 快速回復能力
|
|
26
|
+
└─ Blue-Green 切換、< 30 秒 rollback
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Layer 1:防止錯誤部署
|
|
30
|
+
|
|
31
|
+
### Shell 腳本強制執行
|
|
32
|
+
|
|
33
|
+
所有部署腳本必須以下列標頭開始:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
#!/usr/bin/env bash
|
|
37
|
+
set -euo pipefail
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- `set -e`:任何命令失敗立即退出
|
|
41
|
+
- `set -u`:引用未定義變數視為錯誤
|
|
42
|
+
- `set -o pipefail`:管線中任何命令失敗都會傳播錯誤
|
|
43
|
+
|
|
44
|
+
### 強制部署順序
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
echo "[1/4] 執行測試..."
|
|
48
|
+
npm test
|
|
49
|
+
|
|
50
|
+
echo "[2/4] 建置產物..."
|
|
51
|
+
npm run build
|
|
52
|
+
|
|
53
|
+
echo "[3/4] 推送到伺服器..."
|
|
54
|
+
rsync -avz --delete ./dist/ user@server:/app/
|
|
55
|
+
|
|
56
|
+
echo "[4/4] 驗證部署..."
|
|
57
|
+
./verify.sh || { echo "驗證失敗,執行 rollback..."; ./rollback.sh; exit 1; }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### deploy.lock 防並發
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
LOCK_FILE="/tmp/deploy.lock"
|
|
64
|
+
trap "rm -f $LOCK_FILE" EXIT
|
|
65
|
+
|
|
66
|
+
if [ -f "$LOCK_FILE" ]; then
|
|
67
|
+
echo "❌ 部署進行中(PID: $(cat $LOCK_FILE)),請等待完成"
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
echo $$ > "$LOCK_FILE"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 版本 Tag 強制
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
CURRENT_TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "")
|
|
78
|
+
if [ -z "$CURRENT_TAG" ]; then
|
|
79
|
+
echo "❌ 當前 commit 沒有版本 tag,請先執行:"
|
|
80
|
+
echo " git tag v$(cat VERSION) && git push --tags"
|
|
81
|
+
exit 1
|
|
82
|
+
fi
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Layer 2:驗證部署正確
|
|
86
|
+
|
|
87
|
+
### Smoke Test 腳本 (verify.sh)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
#!/usr/bin/env bash
|
|
91
|
+
set -euo pipefail
|
|
92
|
+
|
|
93
|
+
HEALTH_URL="${HEALTH_URL:-https://example.com/health}"
|
|
94
|
+
EXPECTED_VERSION=$(cat VERSION)
|
|
95
|
+
MAX_RETRIES=3
|
|
96
|
+
RETRY_INTERVAL=5
|
|
97
|
+
|
|
98
|
+
for i in $(seq 1 $MAX_RETRIES); do
|
|
99
|
+
RESPONSE=$(curl -sf --max-time 10 "$HEALTH_URL" 2>/dev/null) && break
|
|
100
|
+
echo "健康檢查失敗 ($i/$MAX_RETRIES),等待 ${RETRY_INTERVAL}s..."
|
|
101
|
+
sleep $RETRY_INTERVAL
|
|
102
|
+
done
|
|
103
|
+
|
|
104
|
+
ACTUAL_VERSION=$(echo "$RESPONSE" | python3 -c "import json,sys; print(json.load(sys.stdin)['version'])")
|
|
105
|
+
|
|
106
|
+
if [ "$ACTUAL_VERSION" != "$EXPECTED_VERSION" ]; then
|
|
107
|
+
echo "❌ 版本不符!預期 $EXPECTED_VERSION,實際 $ACTUAL_VERSION"
|
|
108
|
+
exit 1
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
echo "✅ 版本驗證通過:$ACTUAL_VERSION"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 健康檢查端點規格
|
|
115
|
+
|
|
116
|
+
應用程式必須提供 `/health` 端點,回應格式:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"status": "ok",
|
|
121
|
+
"version": "1.2.3",
|
|
122
|
+
"timestamp": "2026-04-26T10:00:00Z"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Layer 3:快速回復能力
|
|
127
|
+
|
|
128
|
+
### Blue-Green 架構
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
[Nginx]
|
|
132
|
+
│
|
|
133
|
+
├─── Blue (port 3001) ← 穩定版(當前 active)
|
|
134
|
+
└─── Green (port 3002) ← 新版(部署目標)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Nginx 配置**:
|
|
138
|
+
|
|
139
|
+
```nginx
|
|
140
|
+
upstream app {
|
|
141
|
+
server 127.0.0.1:3001; # blue
|
|
142
|
+
# server 127.0.0.1:3002; # green(切換時啟用此行並停用上一行)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
server {
|
|
146
|
+
listen 80;
|
|
147
|
+
location / {
|
|
148
|
+
proxy_pass http://app;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Rollback 腳本 (rollback.sh)
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
#!/usr/bin/env bash
|
|
157
|
+
set -euo pipefail
|
|
158
|
+
|
|
159
|
+
CURRENT=$(readlink /app/current)
|
|
160
|
+
if [[ "$CURRENT" == *"green"* ]]; then
|
|
161
|
+
TARGET="/app/blue"
|
|
162
|
+
else
|
|
163
|
+
TARGET="/app/green"
|
|
164
|
+
fi
|
|
165
|
+
|
|
166
|
+
ln -sfn "$TARGET" /app/current
|
|
167
|
+
nginx -s reload
|
|
168
|
+
|
|
169
|
+
echo "✅ 已切回 $TARGET($(date -u +%Y-%m-%dT%H:%M:%SZ))"
|
|
170
|
+
|
|
171
|
+
# 記錄 rollback 事件
|
|
172
|
+
echo "{\"timestamp\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"event\":\"rollback\",\"from\":\"$CURRENT\",\"to\":\"$TARGET\",\"operator\":\"$(whoami)\"}" >> /var/log/deployments.jsonl
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 完整 Makefile
|
|
176
|
+
|
|
177
|
+
```makefile
|
|
178
|
+
.PHONY: deploy rollback verify
|
|
179
|
+
|
|
180
|
+
deploy:
|
|
181
|
+
@./deploy.sh
|
|
182
|
+
|
|
183
|
+
rollback:
|
|
184
|
+
@./rollback.sh
|
|
185
|
+
|
|
186
|
+
verify:
|
|
187
|
+
@./verify.sh
|
|
188
|
+
|
|
189
|
+
status:
|
|
190
|
+
@echo "Current: $$(readlink /app/current)"
|
|
191
|
+
@curl -s $${HEALTH_URL:-http://localhost/health} | python3 -m json.tool
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Deployment Log 格式
|
|
195
|
+
|
|
196
|
+
每次部署(成功或失敗)都必須寫入 JSON Lines 格式的日誌:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{"timestamp":"2026-04-26T10:00:00Z","version":"1.2.3","git_commit":"abc1234","operator":"albert","result":"success","duration_seconds":45,"slot":"green"}
|
|
200
|
+
{"timestamp":"2026-04-26T11:30:00Z","version":"1.2.4","git_commit":"def5678","operator":"albert","result":"failure","duration_seconds":12,"slot":"green","error":"version_mismatch"}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## 適用場景
|
|
204
|
+
|
|
205
|
+
| 場景 | 建議 |
|
|
206
|
+
|------|------|
|
|
207
|
+
| 個人 VPS / 小型專案 | Layer 1 + Layer 2(無需 Blue-Green) |
|
|
208
|
+
| 自架伺服器(多人團隊) | 三層全套 + deploy.lock |
|
|
209
|
+
| Air-gapped 環境 | 三層全套 + 本地 artifact registry |
|
|
210
|
+
| 容器化部署 | 搭配 `docker compose` 執行 |
|
|
211
|
+
|
|
212
|
+
## 相關標準
|
|
213
|
+
|
|
214
|
+
- `deployment-standards.ai.yaml` — 有 CI/CD 平台的部署策略(本文件的補充前提)
|
|
215
|
+
- `health-check-standards.ai.yaml` — /health 端點設計規範
|
|
216
|
+
- `circuit-breaker.ai.yaml` — 斷路器整合(進階場景)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
**Scope**: universal
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../core/packaging-standards.md
|
|
3
|
-
source_version: 1.
|
|
4
|
-
translation_version: 1.
|
|
5
|
-
last_synced: 2026-
|
|
3
|
+
source_version: 1.1.0
|
|
4
|
+
translation_version: 1.1.0
|
|
5
|
+
last_synced: 2026-06-10
|
|
6
|
+
source_hash: aa338edba3b1
|
|
6
7
|
status: current
|
|
7
8
|
---
|
|
8
9
|
|
|
@@ -10,8 +11,8 @@ status: current
|
|
|
10
11
|
|
|
11
12
|
> **語言**: [English](../../../core/packaging-standards.md) | 繁體中文
|
|
12
13
|
|
|
13
|
-
**版本**: 1.
|
|
14
|
-
**最後更新**: 2026-
|
|
14
|
+
**版本**: 1.1.0
|
|
15
|
+
**最後更新**: 2026-05-26
|
|
15
16
|
**適用性**: 使用 UDS-aware 工具鏈的專案
|
|
16
17
|
**範圍**: 通用 (Universal)
|
|
17
18
|
|
|
@@ -202,6 +203,75 @@ targets:
|
|
|
202
203
|
|
|
203
204
|
---
|
|
204
205
|
|
|
206
|
+
## Archive 格式完整性
|
|
207
|
+
|
|
208
|
+
當打包步驟產生將由部署腳本消費的 archive(`.zip`、`.tar.gz`、`.tar.bz2` 等)時,**真實的二進位格式必須與副檔名相符**。命名為 `.zip` 的檔案必須是真正的 ZIP archive(PKZip magic `PK\x03\x04`),而非改名的 tar archive。
|
|
209
|
+
|
|
210
|
+
> **為何強制要求:** archive 格式不符會在下游觸發靜默失敗。PowerShell 的 `Expand-Archive` 和 `[System.IO.Compression.ZipFile]::ExtractToDirectory()` 接受 tar 改名的 `.zip` **而不拋出錯誤**——檔案被讀取,什麼都沒有解壓縮,也沒有例外。若部署腳本的下一步是破壞性的(例如「刪除現有安裝目錄」),運行中的安裝就會被摧毀而無任何替代物。
|
|
211
|
+
|
|
212
|
+
### 發布前驗證
|
|
213
|
+
|
|
214
|
+
每個產生 archive 的打包步驟**必須**在宣告成功前包含格式驗證。最低驗證要求:
|
|
215
|
+
|
|
216
|
+
| 格式 | 驗證單行指令 |
|
|
217
|
+
|---|---|
|
|
218
|
+
| `.zip` | `python -c "import zipfile; zipfile.ZipFile('out.zip').namelist()"` 必須成功 |
|
|
219
|
+
| `.zip`(Unix) | `file out.zip` 必須回報 `Zip archive data`,**而非** `POSIX tar archive` |
|
|
220
|
+
| `.tar.gz` | `tar -tzf out.tar.gz >/dev/null` 必須成功 |
|
|
221
|
+
| 任何格式 | 選用:雜湊比對預期檔案的 manifest |
|
|
222
|
+
|
|
223
|
+
驗證失敗必須在發布前中止打包管線。
|
|
224
|
+
|
|
225
|
+
### 各平台設定範例
|
|
226
|
+
|
|
227
|
+
**Windows — 應該這樣做:**
|
|
228
|
+
|
|
229
|
+
```powershell
|
|
230
|
+
# 選項 A:PowerShell 內建(產生真正的 ZIP)
|
|
231
|
+
Compress-Archive -Path "publish\*" -DestinationPath "dist\patch.zip" -Force
|
|
232
|
+
|
|
233
|
+
# 選項 B:.NET API(產生真正的 ZIP)
|
|
234
|
+
Add-Type -Assembly System.IO.Compression.FileSystem
|
|
235
|
+
[System.IO.Compression.ZipFile]::CreateFromDirectory(
|
|
236
|
+
"publish", "dist\patch.zip", "Optimal", $false
|
|
237
|
+
)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Windows — 不應該這樣做:**
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# ❌ git-bash / busybox tar -a -cf 在 Windows 上不可靠
|
|
244
|
+
# -a「依副檔名自動」旗標會產生副檔名為 .zip 的 POSIX tar archive。
|
|
245
|
+
# `file patch.zip` → "POSIX tar archive (GNU)"(而非 "Zip archive data")
|
|
246
|
+
cd publish && tar -a -cf "../dist/patch.zip" api/
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**類 Unix — 應該這樣做:**
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# ZIP archive 使用 'zip'(BSD/Linux)
|
|
253
|
+
zip -r dist/patch.zip publish/
|
|
254
|
+
|
|
255
|
+
# tar.gz archive 使用 'tar -czf'(不加 -a)——明確且確定性
|
|
256
|
+
tar -czf dist/patch.tar.gz publish/
|
|
257
|
+
|
|
258
|
+
# 發布前驗證
|
|
259
|
+
file dist/patch.zip # 預期 "Zip archive data"
|
|
260
|
+
python -c "import zipfile; zipfile.ZipFile('dist/patch.zip').namelist()"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 消費端防禦
|
|
264
|
+
|
|
265
|
+
生產端無法保證消費端一定會驗證。消費端(部署腳本)**必須**在任何破壞性動作前驗證 archive 完整性。消費端需求請參閱[部署標準 — 防禦性部署順序](deployment-standards.md#防禦性部署順序)。
|
|
266
|
+
|
|
267
|
+
### 失敗模式參考(真實事故)
|
|
268
|
+
|
|
269
|
+
一個 Windows IIS 正式部署腳本(2026-05-24)在 git-bash 中使用 `tar -a -cf patch.zip api/` 產生其發行 archive。消費端的 PowerShell 部署腳本接著執行 `Expand-Archive`(對 tar 改名檔案靜默空操作),繼續對運行中的 `apiDir` 執行 `Remove-Item -Recurse`,然後從一個不存在的來源執行 `Copy-Item`(因為什麼都沒有被解壓縮)。運行中的安裝被清除,AppPool 停止,正式環境中斷約 3 分鐘,直到完成基於備份的回滾。
|
|
270
|
+
|
|
271
|
+
(a)生產端使用自動副檔名 tar,加上(b)消費端未驗證解壓縮輸出,兩者組合在任何步驟都沒有拋出錯誤的情況下摧毀了運行中的安裝。
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
205
275
|
## 相關標準
|
|
206
276
|
|
|
207
277
|
- [部署標準](deployment-standards.md) — 打包後的部署階段
|
|
@@ -215,6 +285,7 @@ targets:
|
|
|
215
285
|
|
|
216
286
|
| 版本 | 日期 | 變更 |
|
|
217
287
|
|------|------|------|
|
|
288
|
+
| 1.1.0 | 2026-05-26 | 新增:Archive 格式完整性章節——真實格式必須符合副檔名規則、驗證單行指令、Windows 正確/錯誤做法清單、真實事故參考(XSPEC-231 / 關閉 issue #113) |
|
|
218
289
|
| 1.0.0 | 2026-04-15 | 初始發行 — XSPEC-034 Phase 1 |
|
|
219
290
|
|
|
220
291
|
---
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../core/performance-standards.md
|
|
3
|
-
source_version: 1.
|
|
4
|
-
translation_version: 1.
|
|
5
|
-
last_synced: 2026-
|
|
3
|
+
source_version: 1.2.0
|
|
4
|
+
translation_version: 1.2.0
|
|
5
|
+
last_synced: 2026-06-17
|
|
6
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -10,8 +10,8 @@ status: current
|
|
|
10
10
|
|
|
11
11
|
> **語言**: [English](../../../core/performance-standards.md) | 繁體中文
|
|
12
12
|
|
|
13
|
-
**版本**: 1.
|
|
14
|
-
**最後更新**: 2026-
|
|
13
|
+
**版本**: 1.2.0
|
|
14
|
+
**最後更新**: 2026-06-17
|
|
15
15
|
**適用性**: 所有軟體專案
|
|
16
16
|
**範圍**: 通用 (Universal)
|
|
17
17
|
**業界標準**: ISO/IEC 25010 效能效率
|
|
@@ -126,6 +126,83 @@ status: current
|
|
|
126
126
|
|
|
127
127
|
---
|
|
128
128
|
|
|
129
|
+
## 遷移非功能性對等(XSPEC-286)
|
|
130
|
+
|
|
131
|
+
> 屬於 [XSPEC-284](https://github.com/AsiaOstrich/universal-dev-standards) 9 軸遷移完整性矩陣的**軸⑥(非功能)**。涵蓋舊系統重構/重寫時「功能對了、資料對了,但**跑起來不一樣**」這一類遺漏。本節在上述通用基線/漂移機制之上**新增遷移專屬**的 before/after 語義,**不取代**通用效能框架。
|
|
132
|
+
|
|
133
|
+
### 為何是真缺口
|
|
134
|
+
|
|
135
|
+
上述通用基線管理回答的是「**這個版本**相較**它自己**先前的基線是否回歸」,**不**回答「**新**系統是否與它取代的**legacy**對等」。重寫時(如 PHP 單請求 → .NET 共享狀態多執行緒),legacy 的延遲/吞吐/隔離特性多為**隱性、未文件化**,使 per-request 功能對等與 behavior-snapshot 對等都通過,系統卻悄悄跑得更慢、耗盡更小的連線池、或丟失某個鎖語義。
|
|
136
|
+
|
|
137
|
+
### 差分神諭,非絕對門檻
|
|
138
|
+
|
|
139
|
+
遷移對等以 **legacy 為基線** + **宣告容差**,而非上述表格的絕對目標。legacy 量測到的行為就是 oracle,「回歸不超過宣告容差」即 pass。讓分歧自報,而非靠人記得列舉每條熱路徑。
|
|
140
|
+
|
|
141
|
+
### 步驟 1 — 機械化擷取非功能基線(R3)
|
|
142
|
+
|
|
143
|
+
legacy 非功能特性多為隱性。從 legacy artifact **機械化**推導基線(不靠人腦回憶):
|
|
144
|
+
|
|
145
|
+
| 來源 | 推導出的基線項 |
|
|
146
|
+
|------|---------------|
|
|
147
|
+
| 關鍵路由 / controller | 各關鍵路徑 p50 / p95 / p99 延遲 |
|
|
148
|
+
| 熱點查詢 / 慢查詢 log | 每查詢延遲、掃描列數 |
|
|
149
|
+
| 背景作業 / cron | 作業時長、吞吐(records/min) |
|
|
150
|
+
| 連線池設定 | min/max 連線數、idle/connection timeout |
|
|
151
|
+
| 逾時 / rate-limit 設定 | 每端點逾時、requests/min、burst |
|
|
152
|
+
| 交易設定 | 隔離級別(READ COMMITTED / REPEATABLE READ / SERIALIZABLE) |
|
|
153
|
+
|
|
154
|
+
擷取的集合**同時**是回歸 gate 的比較基線**與**資源/限制 parity(步驟 4)的待驗清單。
|
|
155
|
+
|
|
156
|
+
### 步驟 2 — 效能回歸差分 gate(R1)
|
|
157
|
+
|
|
158
|
+
對每條基線路徑,量測新系統對應路徑,與 **legacy 基線**在宣告容差內比較。
|
|
159
|
+
|
|
160
|
+
| 指標 | 預設遷移容差 | block 條件 |
|
|
161
|
+
|------|-------------|-----------|
|
|
162
|
+
| p50 延遲 | ≤ +10%(vs legacy) | > +10% |
|
|
163
|
+
| p95 延遲 | ≤ +15%(vs legacy) | > +15% |
|
|
164
|
+
| p99 延遲 | ≤ +20%(vs legacy) | > +20% |
|
|
165
|
+
| 吞吐 | ≤ -10%(vs legacy) | > -10% 下降 |
|
|
166
|
+
|
|
167
|
+
容差**每路徑可配**(批次作業與互動端點不同)。**shadow** 起手(只量測不 block)以收樣校準每路徑容差,再升為 blocking。
|
|
168
|
+
|
|
169
|
+
**Gate 時機**:pre-UAT(簽核前抓回歸)**與** post-cutover(抓只在真實生產負載下浮現的回歸)。
|
|
170
|
+
|
|
171
|
+
### 步驟 3 — 並發隔離驗證(R2)
|
|
172
|
+
|
|
173
|
+
同一資源(同筆記錄 / 同帳戶餘額 / 同序號)可能被多並發操作存取。legacy 的鎖 / 交易隔離 / 順序保證屬**隱性行為**,重寫常被改變——而**功能測試與 behavior-snapshot 對等都抓不到**(per-request 對等 ≠ 並發對等,與「per-request ≠ data-at-rest」同源盲區)。
|
|
174
|
+
|
|
175
|
+
**方法**:以併發壓力觸發 race,斷言**領域不變量**而非逐一檢查輸出。
|
|
176
|
+
|
|
177
|
+
| 不變量類別 | 範例斷言 |
|
|
178
|
+
|-----------|---------|
|
|
179
|
+
| 守恆 | N 次並發轉帳後 `SUM(balance)` 不變 |
|
|
180
|
+
| 唯一性 | 並發配號下無重複序號 |
|
|
181
|
+
| 無遺失更新 | 已 commit 的寫入不被靜默覆寫 |
|
|
182
|
+
| 順序 | 並發下事件依保證順序套用 |
|
|
183
|
+
|
|
184
|
+
偵測到**隔離降級**(如 legacy SERIALIZABLE → 新 READ COMMITTED、或移除列鎖)即 block。不變量由領域定義;並發案例與狀態轉移/時序不變量重疊時,**狀態機/時序由 XSPEC-287(軸⑧)負責**,並發競態由本節(軸⑥)負責——見 XSPEC-287 §邊界。
|
|
185
|
+
|
|
186
|
+
**Gate 時機**:pre-UAT。
|
|
187
|
+
|
|
188
|
+
### 步驟 4 — 資源 / 限制 parity(R4)
|
|
189
|
+
|
|
190
|
+
驗證 legacy 資源限制不被重寫**無意**改變(逾時從 30s 悄悄降到 5s 會讓長作業失敗;更小的連線池會串行化流量)。納入非功能對帳清單:
|
|
191
|
+
|
|
192
|
+
- [ ] 請求 / 操作**逾時**與 legacy 一致(或變更已宣告)
|
|
193
|
+
- [ ] **Rate limit**(requests/min、burst)與 legacy 一致
|
|
194
|
+
- [ ] **連線池** min/max 與 idle/connection timeout 與 legacy 一致
|
|
195
|
+
- [ ] **批次大小**與 legacy 一致
|
|
196
|
+
- [ ] **交易隔離級別**與 legacy 一致(與步驟 3 交叉檢查)
|
|
197
|
+
|
|
198
|
+
每項要嘛匹配、要嘛有**宣告且具理由**的差異。未宣告的差異即已知回歸風險,block cutover。
|
|
199
|
+
|
|
200
|
+
### 完整性宣告(矩陣對齊)
|
|
201
|
+
|
|
202
|
+
當本節宣告三件事——**清單來源**(步驟 1 機械化基線)、**oracle**(步驟 2 回歸差分 + 步驟 3 不變量斷言)、**gate 時機**(pre-UAT + post-cutover)——即滿足遷移完整性矩陣軸⑥。複用通用基線/漂移與 `observability-assistant` 量測機制——本節只新增遷移 before/after 與並發隔離語義,不重造通用效能框架。
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
129
206
|
## 相關標準
|
|
130
207
|
|
|
131
208
|
- [部署標準](deployment-standards.md)
|
|
@@ -133,3 +210,5 @@ status: current
|
|
|
133
210
|
- [測試標準](testing-standards.md)
|
|
134
211
|
- [需求工程](requirement-engineering.md) - NFR 文件
|
|
135
212
|
- [日誌標準](logging-standards.md) - 效能日誌
|
|
213
|
+
- [行為快照](behavior-snapshot.md) - 功能對等 oracle(與遷移非功能對等互補)
|
|
214
|
+
- [完整覆蓋測試](full-coverage-testing.md) - 並發維度交叉引用
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/pii-classification.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-17
|
|
6
|
+
source_hash: f4ff92c3fe1d
|
|
7
|
+
status: stale
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# PII 分類與處理標準
|
|
11
|
+
|
|
12
|
+
> **Language**: [English](../../../core/pii-classification.md) | 繁體中文
|
|
13
|
+
|
|
14
|
+
> **版本**: 1.0.0 | **狀態**: Active | **更新日期**: 2026-06-17
|
|
15
|
+
> **AI 最佳化版本**: `ai/standards/pii-classification.ai.yaml`
|
|
16
|
+
> **規格**: XSPEC-066(cross-project/specs/XSPEC-066-uds-compliance-audit-pack.md)
|
|
17
|
+
|
|
18
|
+
## 概觀
|
|
19
|
+
|
|
20
|
+
本標準定義**個人可識別資訊(PII)**與敏感個資如何分類、標記、儲存、傳輸與銷毀。
|
|
21
|
+
涵蓋三級資料敏感度分類、各級必備處理控制、資料最小化原則、同意管理要求、保留/
|
|
22
|
+
刪除排程,以及跨境傳輸限制。與 GDPR 第 9 條、CCPA 及一般 privacy-by-design 原則
|
|
23
|
+
對齊。
|
|
24
|
+
|
|
25
|
+
本標準屬於**合規與稽核標準包**(XSPEC-066)。其定義的 PII 等級驅動
|
|
26
|
+
`logging-standards` 執行的遮罩規則,以及 `audit-trail` 記錄的必備資料存取事件。
|
|
27
|
+
|
|
28
|
+
> **範圍**:本標準定義*分類等級*與各級*處理控制*。具體遮罩/tokenization 函式庫、
|
|
29
|
+
> 存放加密金鑰的 secrets store,以及 PIA 工作流程工具屬採用者的選擇。
|
|
30
|
+
|
|
31
|
+
## 需求
|
|
32
|
+
|
|
33
|
+
| ID | 規則 | 等級 |
|
|
34
|
+
|----|------|------|
|
|
35
|
+
| REQ-001 | PII 資料敏感度分類(TIER-1/2/3) | MUST |
|
|
36
|
+
| REQ-002 | 資料最小化與目的限制 | MUST |
|
|
37
|
+
| REQ-003 | 非正式環境的 PII 遮罩與匿名化 | MUST |
|
|
38
|
+
| REQ-004 | 資料保留與刪除排程 | MUST |
|
|
39
|
+
| REQ-005 | 跨境資料傳輸控制 | MUST |
|
|
40
|
+
| REQ-006 | 新功能的 PII 衝擊評估(PIA) | SHOULD |
|
|
41
|
+
|
|
42
|
+
### REQ-001 — PII 資料敏感度分類
|
|
43
|
+
|
|
44
|
+
所有含個人資訊的資料欄位,MUST 在儲存或處理前分類為以下三級之一:
|
|
45
|
+
|
|
46
|
+
| 等級 | 範例 | 必備控制 |
|
|
47
|
+
|------|------|----------|
|
|
48
|
+
| **TIER-1**(高度敏感) | 健康資料、金融帳號、政府識別碼、生物特徵、密碼、SSN | 靜態與傳輸中加密、存取記錄、不快取 |
|
|
49
|
+
| **TIER-2**(敏感) | 全名 + 聯絡資訊組合、位置歷史、行為輪廓、IP 位址 | 傳輸中加密、存取控制 |
|
|
50
|
+
| **TIER-3**(一般 PII) | 僅名、國家層級位置、一般人口統計 | 標準存取控制 |
|
|
51
|
+
|
|
52
|
+
### REQ-002 — 資料最小化與目的限制
|
|
53
|
+
|
|
54
|
+
系統 MUST 僅蒐集明確聲明目的所必需的最少 PII。資料模型中每個 PII 欄位 MUST 具備
|
|
55
|
+
文件化的業務目的與法律依據(同意、契約、正當利益、法律義務)。蒐集未具文件化目的
|
|
56
|
+
的 PII 為 **PROHIBITED**。目的限制 MUST 被強制執行:為目的 A 蒐集的資料,未經另行
|
|
57
|
+
同意 MUST NOT 用於不相關的目的 B。
|
|
58
|
+
|
|
59
|
+
### REQ-003 — 非正式環境的 PII 遮罩與匿名化
|
|
60
|
+
|
|
61
|
+
除非明確需要並經核准,PII MUST NOT 存在於非正式環境(開發、staging、測試)。測試/
|
|
62
|
+
staging 資料庫 MUST 使用匿名化或合成資料。任何核准的例外 MUST 有時限、受存取控制
|
|
63
|
+
並文件化。PII MUST 在應用日誌中遮罩:email 顯示為 `u***@domain.com`、電話為
|
|
64
|
+
`+1-XXX-XXX-1234`、卡號為 `****-****-****-1234`。
|
|
65
|
+
|
|
66
|
+
### REQ-004 — 資料保留與刪除排程
|
|
67
|
+
|
|
68
|
+
每個含 PII 的資料類別 MUST 具備文件化保留排程,其最大保留期須對齊法律要求與業務
|
|
69
|
+
需要。MUST 對超過保留期的資料實作自動刪除。刪除 MUST 可驗證(刪除收據或稽核日誌)。
|
|
70
|
+
行使刪除權(right to erasure)的使用者 MUST 在 30 天內(GDPR)或 45 天內(CCPA)
|
|
71
|
+
收到刪除確認。
|
|
72
|
+
|
|
73
|
+
### REQ-005 — 跨境資料傳輸控制
|
|
74
|
+
|
|
75
|
+
TIER-1 或 TIER-2 PII 的跨國境傳輸 MUST 遵循適用的傳輸機制。EU → 非適足性國家的
|
|
76
|
+
傳輸 MUST 使用標準契約條款(SCC)或拘束性企業規則。資料落地(residency)要求 MUST
|
|
77
|
+
記載於系統設計中。跨境傳輸 MUST 記錄目的地國家與法律依據。
|
|
78
|
+
|
|
79
|
+
### REQ-006 — 新功能的 PII 衝擊評估
|
|
80
|
+
|
|
81
|
+
任何引入新 PII 蒐集或處理的新功能或系統變更,SHOULD 在實作前進行隱私衝擊評估
|
|
82
|
+
(PIA)。PIA MUST 記載:蒐集何種 PII、目的、法律依據、保留期、第三方分享,以及
|
|
83
|
+
風險緩解。含 TIER-1 PII 的功能須強制 PIA;TIER-2 為建議。
|
|
84
|
+
|
|
85
|
+
## 與既有標準的整合
|
|
86
|
+
|
|
87
|
+
- **`audit-trail`**——TIER-1/TIER-2 PII 讀取、匯出與刪除請求為必備稽核事件。
|
|
88
|
+
- **`logging-standards`**——執行本標準要求的遮罩規則。
|
|
89
|
+
- **`security-standards`**——TIER-1 的靜態/傳輸加密控制引用專案安全基線。
|
|
90
|
+
- **`database-standards`**——資料字典欄位帶有 PII 等級與 REQ-002 的文件化目的/
|
|
91
|
+
法律依據。
|
|
92
|
+
|
|
93
|
+
## 相關規格
|
|
94
|
+
|
|
95
|
+
- XSPEC-066 — UDS 合規與稽核標準包(本標準來源)
|
|
96
|
+
- DEC-041 — EU AI Act 2026 合規(PII 處理作為合規支柱)
|
|
97
|
+
|
|
98
|
+
## 變更紀錄
|
|
99
|
+
|
|
100
|
+
| 版本 | 日期 | 變更 |
|
|
101
|
+
|------|------|------|
|
|
102
|
+
| v1.0.0 | 2026-06-17 | 初版——REQ-001~006:PII 等級、資料最小化、非正式環境遮罩、保留/刪除、跨境傳輸、PIA(XSPEC-066) |
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/pipeline-security-gates.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-10
|
|
6
|
+
source_hash: a2d6e88e26c8
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Pipeline Security Gates(CI Pipeline 安全檢查點)
|
|
11
|
+
|
|
12
|
+
> **Language**: [English](../../../core/pipeline-security-gates.md) | 繁體中文
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 概述
|
|
17
|
+
|
|
18
|
+
本標準定義嵌入 CI pipeline 各階段的安全檢查點,涵蓋 SAST、DAST、SCA(含 SBOM)和機密掃描,並明確規定各類發現的阻斷(Block)、警告(Warn)、記錄(Log)行為。
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 核心原則
|
|
23
|
+
|
|
24
|
+
- **機密掃描在 pre-commit**:所有包含機密的提交都必須被阻擋,不得例外
|
|
25
|
+
- **SAST 在建置後**:Critical 和 High 等級發現阻斷 pipeline
|
|
26
|
+
- **SCA + SBOM 在封包階段**:追蹤相依套件風險並產生物料清單
|
|
27
|
+
- **DAST 在 staging 部署後**:對運行中的應用進行動態掃描
|
|
28
|
+
- **安全閘門失敗 = pipeline 失敗**:不得視為可忽略的警告
|
|
29
|
+
- **任何繞過都需審計軌跡**:禁止靜默跳過安全閘門
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 安全閘門位置與配置
|
|
34
|
+
|
|
35
|
+
### 1. Pre-Commit — 機密掃描
|
|
36
|
+
|
|
37
|
+
| 項目 | 說明 |
|
|
38
|
+
|------|------|
|
|
39
|
+
| 掃描範圍 | 所有 staged 檔案 |
|
|
40
|
+
| 推薦工具 | gitleaks、trufflehog、detect-secrets |
|
|
41
|
+
| 阻斷條件 | 任何機密模式匹配 |
|
|
42
|
+
| 可跳過 | 否(`never_skip: true`) |
|
|
43
|
+
|
|
44
|
+
**重要**:此閘門必須在程式碼進入版本控制前執行,一旦機密進入 git 歷史便需要完整的機密輪換程序。
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
### 2. Post-Build — SAST(靜態應用安全測試)
|
|
49
|
+
|
|
50
|
+
| 項目 | 說明 |
|
|
51
|
+
|------|------|
|
|
52
|
+
| 掃描範圍 | 原始碼 + 建置產出物 |
|
|
53
|
+
| 推薦工具 | semgrep、codeql、sonarqube |
|
|
54
|
+
| 阻斷條件 | Critical、High |
|
|
55
|
+
| 警告條件 | Medium |
|
|
56
|
+
| 僅記錄 | Low、Info |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### 3. Package Stage — SCA + SBOM
|
|
61
|
+
|
|
62
|
+
| 項目 | 說明 |
|
|
63
|
+
|------|------|
|
|
64
|
+
| 掃描範圍 | 相依套件 + 容器映像 |
|
|
65
|
+
| 推薦工具 | trivy、syft、grype、dependabot |
|
|
66
|
+
| 阻斷條件 | Critical CVE(有可用修復版本) |
|
|
67
|
+
| 警告條件 | High CVE、過時相依套件 |
|
|
68
|
+
| SBOM 格式 | SPDX、CycloneDX |
|
|
69
|
+
|
|
70
|
+
**SBOM 用途**:上傳至 dependency-track 或 grype-db 進行持續監控。
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### 4. Post-Staging Deploy — DAST(動態應用安全測試)
|
|
75
|
+
|
|
76
|
+
| 項目 | 說明 |
|
|
77
|
+
|------|------|
|
|
78
|
+
| 掃描範圍 | 運行中的 staging 應用程式 |
|
|
79
|
+
| 推薦工具 | ZAP、nuclei、BurpSuite Enterprise |
|
|
80
|
+
| 阻斷條件 | Critical |
|
|
81
|
+
| 需審核批准 | High |
|
|
82
|
+
| 警告條件 | Medium |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 嚴重性回應矩陣
|
|
87
|
+
|
|
88
|
+
| 嚴重性 | 動作 | 通知對象 | SLA |
|
|
89
|
+
|--------|------|---------|-----|
|
|
90
|
+
| Critical | 阻斷 pipeline | 資安團隊 | 立即 |
|
|
91
|
+
| High | 阻斷 pipeline | 團隊主管 | 當日 |
|
|
92
|
+
| Medium | 警告 + 需審核批准 | 開發者 | 下個 Sprint |
|
|
93
|
+
| Low | 僅記錄 | 無 | Backlog |
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 繞過政策
|
|
98
|
+
|
|
99
|
+
**預設禁止繞過**。
|
|
100
|
+
|
|
101
|
+
若有特殊情況:
|
|
102
|
+
- **例外流程**:需書面資安審核 + 審計日誌記錄
|
|
103
|
+
- **緊急繞過**:時效性令牌(time-limited token)+ 強制事後審查
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 整合點
|
|
108
|
+
|
|
109
|
+
| 整合項目 | 說明 |
|
|
110
|
+
|---------|------|
|
|
111
|
+
| 機密管理 | 整合 HashiCorp Vault 或 AWS Secrets Manager 進行機密注入 |
|
|
112
|
+
| SBOM 註冊表 | 上傳 SBOM 至 dependency-track 或 grype-db 持續監控 |
|
|
113
|
+
| 事故回應 | Critical 發現自動建立事故單 |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 相關標準
|
|
118
|
+
|
|
119
|
+
- [security-standards.md](../../../core/security-standards.md) — 應用安全基礎標準
|
|
120
|
+
- [pipeline-integration-standards.md](../../../core/pipeline-integration-standards.md) — CI 管線整合標準
|
|
121
|
+
- [deployment-standards.md](../../../core/deployment-standards.md) — 部署基礎原則
|
|
122
|
+
- AI 格式:[pipeline-security-gates.ai.yaml](../../../ai/standards/pipeline-security-gates.ai.yaml)
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
**Scope**: universal
|