universal-dev-standards 5.17.0 → 6.1.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/options/commit-message/bilingual.ai.yaml +19 -1
- 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 +3 -3
- 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/documentation-writing-standards.ai.yaml +1 -1
- 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/frontend-design-standards.ai.yaml +33 -3
- 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/push-standards.ai.yaml +14 -3
- package/bundled/ai/standards/refactoring-standards.ai.yaml +68 -3
- package/bundled/ai/standards/requirement-engineering.ai.yaml +42 -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/self-review-protocol.ai.yaml +15 -10
- 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-evidence.ai.yaml +88 -5
- 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 +10 -3
- 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 +2 -2
- package/bundled/core/error-code-standards.md +4 -3
- package/bundled/core/feature-discovery-standards.md +191 -0
- 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/frontend-design-standards.md +93 -4
- 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/multi-environment-e2e-testing.md +195 -0
- 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/push-standards.md +82 -0
- package/bundled/core/refactoring-standards.md +44 -3
- package/bundled/core/replay-test.md +1 -1
- package/bundled/core/requirement-engineering.md +2 -2
- 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 +15 -10
- 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-evidence.md +170 -10
- package/bundled/core/verification-oracle.md +167 -0
- package/bundled/core/versioning.md +133 -109
- package/bundled/locales/COVERAGE.md +94 -77
- package/bundled/locales/zh-CN/CHANGELOG.md +94 -6
- package/bundled/locales/zh-CN/CLAUDE.md +1 -1
- package/bundled/locales/zh-CN/MAINTENANCE.md +42 -661
- package/bundled/locales/zh-CN/README.md +25 -12
- package/bundled/locales/zh-CN/SECURITY.md +2 -2
- package/bundled/locales/zh-CN/adoption/DAILY-WORKFLOW-GUIDE.md +2 -2
- package/bundled/locales/zh-CN/ai/options/commit-message/bilingual.ai.yaml +6 -1
- 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 +239 -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 +200 -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/frontend-design-standards.md +1 -1
- package/bundled/locales/zh-CN/core/full-coverage-testing.md +269 -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 +131 -0
- package/bundled/locales/zh-CN/core/llm-output-validation.md +192 -0
- package/bundled/locales/zh-CN/core/logging-standards.md +205 -7
- package/bundled/locales/zh-CN/core/mock-boundary.md +161 -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 +77 -5
- package/bundled/locales/zh-CN/core/pipeline-security-gates.md +146 -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/requirement-engineering.md +1 -1
- 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 +113 -0
- package/bundled/locales/zh-CN/core/self-review-protocol.md +172 -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/verification-evidence.md +252 -41
- package/bundled/locales/zh-CN/core/versioning.md +1 -1
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +36 -7
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +71 -53
- 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/commit-message/bilingual.md +10 -3
- 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 +115 -17
- package/bundled/locales/zh-CN/skills/brainstorm-assistant/guide.md +37 -12
- 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 +169 -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 +94 -6
- package/bundled/locales/zh-TW/CLAUDE.md +1 -1
- package/bundled/locales/zh-TW/MAINTENANCE.md +51 -4
- package/bundled/locales/zh-TW/README.md +25 -12
- package/bundled/locales/zh-TW/SECURITY.md +2 -2
- package/bundled/locales/zh-TW/adoption/DAILY-WORKFLOW-GUIDE.md +2 -2
- package/bundled/locales/zh-TW/ai/options/commit-message/bilingual.ai.yaml +6 -1
- 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/frontend-design-standards.md +1 -1
- 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 +131 -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 +77 -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 +146 -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/requirement-engineering.md +1 -1
- 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 +113 -0
- package/bundled/locales/zh-TW/core/self-review-protocol.md +18 -13
- 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-evidence.md +260 -31
- 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 +36 -7
- package/bundled/locales/zh-TW/docs/DEV-WORKFLOW-MAPPING.md +6 -6
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +71 -53
- 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/commit-message/bilingual.md +10 -3
- 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 +116 -18
- package/bundled/locales/zh-TW/skills/brainstorm-assistant/guide.md +38 -11
- 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 +52 -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 +139 -15
- package/bundled/skills/brainstorm-assistant/guide.md +39 -8
- 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 +13 -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 +4 -4
- 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 +168 -75
- 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 +61 -149
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../core/ai-response-navigation.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
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -10,8 +10,8 @@ status: current
|
|
|
10
10
|
|
|
11
11
|
> **語言**: [English](../../../core/ai-response-navigation.md) | 繁體中文 | [简体中文](../../zh-CN/core/ai-response-navigation.md)
|
|
12
12
|
|
|
13
|
-
**版本**: 1.
|
|
14
|
-
**最後更新**: 2026-
|
|
13
|
+
**版本**: 1.1.0
|
|
14
|
+
**最後更新**: 2026-06-10
|
|
15
15
|
**適用範圍**: 所有使用 AI 輔助開發的專案
|
|
16
16
|
**範圍**: universal
|
|
17
17
|
**產業標準**: 無(新興 AI 工具實踐)
|
|
@@ -77,6 +77,30 @@ status: current
|
|
|
77
77
|
|
|
78
78
|
當下一步建議對應到已知的斜線命令時,使用 `` `/command` `` 格式引用,讓使用者可以直接複製執行。沒有對應命令的步驟使用自然語言描述。
|
|
79
79
|
|
|
80
|
+
### 規則 6:模型級別標注(選用)
|
|
81
|
+
|
|
82
|
+
當某個下一步選項明確對應到特定的複雜度等級時,可**選擇性**附加模型級別提示。此標注**嚴格為選用**——既有技能無需回頭修改;新增或修訂技能時建議帶入。
|
|
83
|
+
|
|
84
|
+
**標注方式**:在選項描述後加上 `〔模型:Fast〕`、`〔模型:Standard〕` 或 `〔模型:Capable〕`。
|
|
85
|
+
|
|
86
|
+
**等級判斷依據**:參考 [model-selection](model-selection.md) 標準的複雜度信號:
|
|
87
|
+
- `Fast` — 修改單一檔案、spec 完全明確、無需設計判斷
|
|
88
|
+
- `Standard` — 2-5 個檔案、需要模組間理解
|
|
89
|
+
- `Capable` — 5+ 個檔案、架構決策、跨系統正確性
|
|
90
|
+
|
|
91
|
+
等級名稱**與廠商無關**——各工具或平台自行將等級映射到可用的模型。
|
|
92
|
+
|
|
93
|
+
**英文標注對照**:`〔model: Fast〕` / `〔model: Standard〕` / `〔model: Capable〕`
|
|
94
|
+
|
|
95
|
+
**示例**(任務完成,含模型標注):
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
> **建議下一步:**
|
|
99
|
+
> - 執行 `/derive bdd` 推導 BDD 場景 `〔模型:Fast〕` — 格式轉換工作
|
|
100
|
+
> - 執行 `/checkin` 進行品質關卡驗證 ⭐ **推薦** `〔模型:Standard〕` — 需要模組間判斷
|
|
101
|
+
> - 執行 `/sdd` 整合架構設計 `〔模型:Capable〕` — 跨系統影響分析
|
|
102
|
+
```
|
|
103
|
+
|
|
80
104
|
---
|
|
81
105
|
|
|
82
106
|
## 情境模板
|
|
@@ -217,7 +241,7 @@ AI 需要使用者做出選擇或提供資訊時使用。
|
|
|
217
241
|
> **建議下一步:**
|
|
218
242
|
> - 執行 `/test` 為新功能撰寫測試
|
|
219
243
|
> - 執行 `/commit` 提交變更 ⭐ **推薦** — 變更已完整且通過驗證
|
|
220
|
-
> - 執行 `/review` 進行自我審查
|
|
244
|
+
> - 執行 `/code-review` 進行自我審查
|
|
221
245
|
```
|
|
222
246
|
|
|
223
247
|
### 範例 2:詢問使用者設計問題
|
|
@@ -265,6 +289,7 @@ AI 需要使用者做出選擇或提供資訊時使用。
|
|
|
265
289
|
| R3 | 模板匹配回應類型 |
|
|
266
290
|
| R4 | 1–5 個選項,依情境調整 |
|
|
267
291
|
| R5 | 適用時使用 `/command` 格式 |
|
|
292
|
+
| R6 | *(選用)* 等級明確時附加 `〔模型:Fast|Standard|Capable〕` |
|
|
268
293
|
|
|
269
294
|
| 豁免 | 不豁免 |
|
|
270
295
|
|------|--------|
|
|
@@ -288,6 +313,7 @@ AI 需要使用者做出選擇或提供資訊時使用。
|
|
|
288
313
|
|
|
289
314
|
| 版本 | 日期 | 變更 |
|
|
290
315
|
|------|------|------|
|
|
316
|
+
| 1.1.0 | 2026-06-10 | 新增規則 R6 選用模型級別標注(`〔模型:Fast|Standard|Capable〕`);與廠商無關;不強制既有技能回改 |
|
|
291
317
|
| 1.0.0 | 2026-03-25 | 初始版本 |
|
|
292
318
|
|
|
293
319
|
---
|
|
@@ -189,4 +189,4 @@ LLM 的迎合性源自 RLHF 訓練目標:人類評分者傾向於給予令人
|
|
|
189
189
|
## 相關標準
|
|
190
190
|
|
|
191
191
|
- [anti-hallucination.md](../../../core/anti-hallucination.md) — 防止幻覺;與防迎合互補
|
|
192
|
-
- [agent-epistemic-calibration.md](../../../core/
|
|
192
|
+
- [agent-epistemic-calibration.md](../../../core/anti-hallucination.md) — Agent 設計中的認知謙遜(若適用)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../core/api-design-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-24
|
|
6
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ status: current
|
|
|
10
10
|
|
|
11
11
|
> **語言**: [English](../../../core/api-design-standards.md) | 繁體中文
|
|
12
12
|
|
|
13
|
-
> 版本: 1.
|
|
13
|
+
> 版本: 1.1.0 | 最後更新: 2026-06-24
|
|
14
14
|
|
|
15
15
|
**適用範圍**: 所有軟體專案
|
|
16
16
|
**範疇**: universal
|
|
@@ -173,12 +173,14 @@ https://api.example.com/v2/users
|
|
|
173
173
|
|
|
174
174
|
### 版本生命週期
|
|
175
175
|
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
API 版本會經歷四種狀態。其中的**持續時間**——平行支援期與棄用通知期——是[棄用與日落標準](deprecation-standards.md#api-棄用)的單一職責;本表只定義狀態與各狀態下的 API 契約動作,使時間數字只存在於單一處。
|
|
177
|
+
|
|
178
|
+
| 階段 | 狀態 | API 契約動作 |
|
|
179
|
+
|------|------|------|
|
|
178
180
|
| **現行** | 積極開發中 | 完整支援、新功能 |
|
|
179
|
-
| **支援中** |
|
|
180
|
-
| **已棄用** |
|
|
181
|
-
| **已終止** |
|
|
181
|
+
| **支援中** | 與後繼版本平行維護 | 僅限錯誤修復、安全修補 |
|
|
182
|
+
| **已棄用** | 已宣告退役 | `Deprecation` / `Sunset` 標頭、發布遷移指南 |
|
|
183
|
+
| **已終止** | 已移除 | 回傳 `410 Gone` 與遷移資訊 |
|
|
182
184
|
|
|
183
185
|
### 棄用標頭
|
|
184
186
|
|
|
@@ -188,6 +190,85 @@ Deprecation: true
|
|
|
188
190
|
Link: <https://api.example.com/v2/docs>; rel="successor-version"
|
|
189
191
|
```
|
|
190
192
|
|
|
193
|
+
> 完整的棄用**流程**(分階段的 Sunset 時間線)與**依 API 分級的最短通知期間**,由[棄用與日落標準](deprecation-standards.md#api-棄用)掌管。本標準負責下方的 API 契約面:如何在程式碼中棄用版本、何謂破壞性變更、以及如何撰寫遷移指南。
|
|
194
|
+
|
|
195
|
+
### 棄用 API 版本
|
|
196
|
+
|
|
197
|
+
透過 SemVer 與 API 本身發出棄用訊號,再依循棄用生命週期。版本演進對應[語義化版本](versioning.md#遞增規則):
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
v1.0.0 — 版本引入
|
|
201
|
+
v1.5.0 — 宣告棄用(不晚於移除前的 N-1 minor)
|
|
202
|
+
v2.0.0 — 移除版本(破壞性變更 → MAJOR 遞增)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
標記已棄用的程式碼,讓呼叫端在移除版本前就能看到警告:
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
208
|
+
// v1.5.0 — 加入棄用警告
|
|
209
|
+
/**
|
|
210
|
+
* @deprecated Use authenticateV2() instead. Will be removed in v2.0.0
|
|
211
|
+
*/
|
|
212
|
+
function authenticate(username, password) {
|
|
213
|
+
console.warn('[DEPRECATED] authenticate() will be removed in v2.0.0. Use authenticateV2()');
|
|
214
|
+
return authenticateV2(username, password);
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 向後相容性檢查清單
|
|
219
|
+
|
|
220
|
+
發布前,將每項變更分類。第一份清單中的任何項目皆屬**破壞性**,需升級 MAJOR 版本(見[語義化版本](versioning.md#遞增規則));第二份清單中的項目向後相容,可在 MINOR 或 PATCH 版本發布。
|
|
221
|
+
|
|
222
|
+
**破壞性——不升級 MAJOR 版本絕不可做:**
|
|
223
|
+
- [ ] 移除公開 API 端點
|
|
224
|
+
- [ ] 移除必填請求欄位
|
|
225
|
+
- [ ] 新增必填請求欄位
|
|
226
|
+
- [ ] 變更回應欄位的類型
|
|
227
|
+
- [ ] 變更錯誤碼的含義
|
|
228
|
+
- [ ] 移除消費者依賴的回應欄位
|
|
229
|
+
|
|
230
|
+
**向後相容——可在 MINOR 或 PATCH 版本安全發布:**
|
|
231
|
+
- [ ] 新增可選請求欄位
|
|
232
|
+
- [ ] 新增回應欄位
|
|
233
|
+
- [ ] 新增端點
|
|
234
|
+
- [ ] 新增錯誤碼
|
|
235
|
+
- [ ] 改善錯誤訊息
|
|
236
|
+
- [ ] 效能改進
|
|
237
|
+
|
|
238
|
+
### API 遷移指南
|
|
239
|
+
|
|
240
|
+
當 MAJOR 版本帶有破壞性變更時,發布一份遷移指南,將每個舊用法對應到其替代方案:
|
|
241
|
+
|
|
242
|
+
````markdown
|
|
243
|
+
# 遷移指南:v1.x 到 v2.0
|
|
244
|
+
|
|
245
|
+
## 破壞性變更
|
|
246
|
+
|
|
247
|
+
### 1. authenticate() 已移除
|
|
248
|
+
|
|
249
|
+
**Before (v1.x)**:
|
|
250
|
+
```javascript
|
|
251
|
+
const token = await authenticate('user', 'pass');
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**After (v2.0)**:
|
|
255
|
+
```javascript
|
|
256
|
+
const token = await authenticateV2({ username: 'user', password: 'pass' });
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### 2. API 回應格式變更
|
|
260
|
+
|
|
261
|
+
**Before (v1.x)**: `{ "data": { "user": {...} } }`
|
|
262
|
+
**After (v2.0)**: `{ "user": {...} }`
|
|
263
|
+
|
|
264
|
+
```javascript
|
|
265
|
+
// Before
|
|
266
|
+
const user = response.data.user;
|
|
267
|
+
// After
|
|
268
|
+
const user = response.user;
|
|
269
|
+
```
|
|
270
|
+
````
|
|
271
|
+
|
|
191
272
|
---
|
|
192
273
|
|
|
193
274
|
## 請求/回應標準
|
|
@@ -925,6 +1006,7 @@ Content-Security-Policy: default-src 'none'
|
|
|
925
1006
|
|
|
926
1007
|
| 版本 | 日期 | 變更 |
|
|
927
1008
|
|------|------|------|
|
|
1009
|
+
| 1.1.0 | 2026-06-24 | 新增:棄用 API 版本、向後相容性檢查清單、API 遷移指南(自 versioning.md 整併);版本生命週期的所有期間數字改由 deprecation-standards 作為單一真實來源(XSPEC-298 R8、UDS #126) |
|
|
928
1010
|
| 1.0.0 | 2026-03-18 | 初始版本 |
|
|
929
1011
|
|
|
930
1012
|
---
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/audit-trail.md
|
|
3
|
+
source_version: 1.0.0
|
|
4
|
+
translation_version: 1.0.0
|
|
5
|
+
last_synced: 2026-06-17
|
|
6
|
+
source_hash: 7543ded62881
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 稽核軌跡標準
|
|
11
|
+
|
|
12
|
+
> **Language**: [English](../../../core/audit-trail.md) | 繁體中文
|
|
13
|
+
|
|
14
|
+
> **版本**: 1.0.0 | **狀態**: Active | **更新日期**: 2026-06-17
|
|
15
|
+
> **AI 最佳化版本**: `ai/standards/audit-trail.ai.yaml`
|
|
16
|
+
> **規格**: XSPEC-066(cross-project/specs/XSPEC-066-uds-compliance-audit-pack.md)
|
|
17
|
+
|
|
18
|
+
## 概觀
|
|
19
|
+
|
|
20
|
+
本標準定義在處理敏感資料、金融交易、權限變更與合規相關操作的系統中,如何建立、
|
|
21
|
+
儲存與管理**不可變稽核軌跡(immutable audit trail)**。涵蓋必備事件類型、稽核紀錄
|
|
22
|
+
結構、防篡改要求、保留期、查詢/匯出能力,以及 SIEM 整合。設計目標為滿足 SOC 2、
|
|
23
|
+
ISO 27001、GDPR 與金融法規要求。
|
|
24
|
+
|
|
25
|
+
本標準屬於**合規與稽核標準包**(XSPEC-066)。稽核軌跡是 EU AI Act 可稽核性
|
|
26
|
+
(DEC-041)與 VibeOps Governance Agent 介入紀錄(DEC-042)的核心載體,並與治理閘門
|
|
27
|
+
家族——`license-compliance`(XSPEC-193)、`verification-oracle`(XSPEC-256)、
|
|
28
|
+
`model-provenance`(XSPEC-255)——組合:這些閘門的裁決會寫入符合本標準的稽核軌跡。
|
|
29
|
+
|
|
30
|
+
> **範圍**:本標準定義「該稽核什麼」、「紀錄結構」以及「不可變/保留/存取」規則。
|
|
31
|
+
> 具體儲存引擎(S3 Object Lock、append-only DB、雜湊鏈函式庫)與 SIEM 產品屬採用者
|
|
32
|
+
> 的選擇,不在本標準範圍內。
|
|
33
|
+
|
|
34
|
+
## 需求
|
|
35
|
+
|
|
36
|
+
| ID | 規則 | 等級 |
|
|
37
|
+
|----|------|------|
|
|
38
|
+
| REQ-001 | 必備可稽核事件類型(認證、授權、資料存取、設定、金融、合規) | MUST |
|
|
39
|
+
| REQ-002 | 稽核紀錄結構(必備 + 建議欄位) | MUST |
|
|
40
|
+
| REQ-003 | 不可變性與防篡改(append-only + 雜湊鏈) | MUST |
|
|
41
|
+
| REQ-004 | 各類別的稽核日誌保留期 | MUST |
|
|
42
|
+
| REQ-005 | 查詢與匯出能力(可篩選、可匯出、查詢動作本身亦記錄) | MUST |
|
|
43
|
+
| REQ-006 | SIEM 整合與告警 | SHOULD |
|
|
44
|
+
|
|
45
|
+
### REQ-001 — 必備可稽核事件類型
|
|
46
|
+
|
|
47
|
+
系統 MUST 無例外地為下列事件記錄稽核紀錄:(1) **認證**——登入成功/失敗、登出、
|
|
48
|
+
MFA 事件、密碼變更;(2) **授權**——存取核准/拒絕、權限提升、角色變更;
|
|
49
|
+
(3) **資料存取**——TIER-1 與 TIER-2 PII(見 `pii-classification`)的讀/寫/刪、
|
|
50
|
+
大量資料匯出;(4) **設定變更**——系統設定、安全政策變更、使用者/角色管理;
|
|
51
|
+
(5) **金融交易**——付款處理、退款、餘額變動;(6) **合規相關操作**——同意變更、
|
|
52
|
+
資料刪除請求、法律保留(legal hold)。
|
|
53
|
+
|
|
54
|
+
### REQ-002 — 稽核紀錄結構
|
|
55
|
+
|
|
56
|
+
每筆稽核紀錄 MUST 包含:`event_id`(UUID v4)、`event_type`(列舉字串)、
|
|
57
|
+
`timestamp`(含毫秒的 ISO 8601 UTC)、`actor_id`(使用者或服務帳號)、`actor_ip`
|
|
58
|
+
(使用者操作時)、`resource_type`、`resource_id`、`action`、`outcome`(成功/失敗)
|
|
59
|
+
與 `environment`(production/staging)。SHOULD 另含 `session_id`、用於關聯的
|
|
60
|
+
`request_id`、變更操作的前後狀態,以及地理區域。
|
|
61
|
+
|
|
62
|
+
### REQ-003 — 不可變性與防篡改
|
|
63
|
+
|
|
64
|
+
稽核日誌 MUST 寫入 **append-only** 儲存體,防止應用層主體修改或刪除。每筆紀錄
|
|
65
|
+
MUST 包含前一筆紀錄的密碼學雜湊(**鏈接**)以偵測篡改。稽核儲存體的寫入權限
|
|
66
|
+
MUST 僅限稽核服務本身——任何工程師或應用服務皆不得直接寫入。日誌完整性 MUST
|
|
67
|
+
可隨選驗證。
|
|
68
|
+
|
|
69
|
+
### REQ-004 — 稽核日誌保留期
|
|
70
|
+
|
|
71
|
+
稽核日誌 MUST 依類別至少保留:認證/授權——熱儲存 1 年、冷儲存 6 年(SOC 2 /
|
|
72
|
+
ISO 27001);金融交易——7 年(金融法規);PII 存取——3 年;設定變更——3 年;
|
|
73
|
+
其餘稽核事件——1 年。在保留期屆滿前刪除稽核紀錄為 **PROHIBITED**。接近到期的
|
|
74
|
+
日誌 MUST 自動封存至冷儲存。
|
|
75
|
+
|
|
76
|
+
### REQ-005 — 稽核日誌查詢與匯出能力
|
|
77
|
+
|
|
78
|
+
稽核系統 MUST 支援以 `event_type`、`actor_id`、`resource_id`、時間範圍與 `outcome`
|
|
79
|
+
篩選。結果 MUST 可匯出為 JSON 與 CSV。回傳 PII 的查詢 MUST 自身亦記錄為稽核事件
|
|
80
|
+
(查詢的查詢)。稽核資料 MUST 在請求後 4 小時內供獲授權的合規/安全團隊存取,
|
|
81
|
+
並在 24 小時內供監管機關存取。
|
|
82
|
+
|
|
83
|
+
### REQ-006 — SIEM 整合與告警
|
|
84
|
+
|
|
85
|
+
稽核日誌 SHOULD 即時轉送至 SIEM 系統。SIEM SHOULD 具備自動偵測規則:暴力登入樣態
|
|
86
|
+
(5 分鐘內 >5 次失敗)、營業時間外的權限提升、大量 PII 匯出(1 小時內 >1000 筆)、
|
|
87
|
+
以及來自新地理區域的存取。高嚴重度偵測 SHOULD 觸發 on-call 通知。
|
|
88
|
+
|
|
89
|
+
## 與既有標準的整合
|
|
90
|
+
|
|
91
|
+
- **`pii-classification`**——資料存取稽核以所觸及欄位的 PII 等級為依據(TIER-1/
|
|
92
|
+
TIER-2 讀取為必備稽核事件)。
|
|
93
|
+
- **`logging-standards`**——稽核紀錄是凌駕一般應用日誌之上、獨立且不可變的類別;
|
|
94
|
+
`pii-classification` 的遮罩規則仍適用。
|
|
95
|
+
- **`license-compliance` / `verification-oracle` / `model-provenance`**——治理閘門
|
|
96
|
+
裁決(封鎖/override)會寫入稽核軌跡。
|
|
97
|
+
- **`execution-history`**——一般執行紀錄無法取代合規等級、防篡改的稽核軌跡。
|
|
98
|
+
|
|
99
|
+
## 相關規格
|
|
100
|
+
|
|
101
|
+
- XSPEC-066 — UDS 合規與稽核標準包(本標準來源)
|
|
102
|
+
- DEC-041 — EU AI Act 2026 合規(稽核軌跡作為可稽核性載體)
|
|
103
|
+
- DEC-042 — Guardian / Governance Agent 模式(介入可稽核性)
|
|
104
|
+
- DEC-020 — VibeOps 商業雙授權(授權合規稽核)
|
|
105
|
+
|
|
106
|
+
## 變更紀錄
|
|
107
|
+
|
|
108
|
+
| 版本 | 日期 | 變更 |
|
|
109
|
+
|------|------|------|
|
|
110
|
+
| v1.0.0 | 2026-06-17 | 初版——REQ-001~006:事件類型、紀錄結構、不可變性/防篡改、保留期、查詢/匯出、SIEM 整合(XSPEC-066) |
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
source: ../../../core/behavior-snapshot.md
|
|
3
|
+
source_version: 1.1.0
|
|
4
|
+
translation_version: 1.1.0
|
|
5
|
+
last_synced: 2026-06-28
|
|
6
|
+
source_hash: 36a3683ae75b
|
|
7
|
+
status: current
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 行為快照標準
|
|
11
|
+
|
|
12
|
+
> **語言**: [English](../../../core/behavior-snapshot.md) | 繁體中文 | [简体中文](../../zh-CN/core/behavior-snapshot.md)
|
|
13
|
+
|
|
14
|
+
**適用範圍**:需要行為一致性驗證的遷移與重構專案
|
|
15
|
+
**Scope**: universal
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 概述
|
|
20
|
+
|
|
21
|
+
行為快照標準定義了一種黃金檔案格式,用於記錄現有系統的 HTTP 請求/回應配對。這些快照有兩個用途:
|
|
22
|
+
|
|
23
|
+
1. **遷移一致性基準線** — 驗證新系統能重現與舊系統相同的行為
|
|
24
|
+
2. **重構特性化** — 在修改程式碼前鎖定現有行為(Gate 0 協議)
|
|
25
|
+
|
|
26
|
+
## 參考資料
|
|
27
|
+
|
|
28
|
+
| 標準/來源 | 內容 |
|
|
29
|
+
|----------------|---------|
|
|
30
|
+
| XSPEC-201 | 重構/遷移完整性協議 |
|
|
31
|
+
| Michael Feathers: *Working Effectively with Legacy Code* | 特性化測試概念 |
|
|
32
|
+
| Golden Master Testing | 記錄並重放預期輸出的模式 |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 快照檔案格式
|
|
37
|
+
|
|
38
|
+
### 位置
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
.snapshots/<feature-id>/<scenario>.json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Schema
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"feature_id": "FM-007",
|
|
49
|
+
"scenario": "happy_path",
|
|
50
|
+
"request": {
|
|
51
|
+
"method": "POST",
|
|
52
|
+
"path": "/api/orders/123/cancel",
|
|
53
|
+
"headers": {
|
|
54
|
+
"Content-Type": "application/json"
|
|
55
|
+
},
|
|
56
|
+
"body": {
|
|
57
|
+
"reason": "customer_request"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"response": {
|
|
61
|
+
"status": 200,
|
|
62
|
+
"body": {
|
|
63
|
+
"success": true,
|
|
64
|
+
"order_status": "cancelled",
|
|
65
|
+
"refund_initiated": true
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"ignore_fields": ["refund_id", "cancelled_at"]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 欄位參考
|
|
73
|
+
|
|
74
|
+
| 欄位 | 必填 | 說明 |
|
|
75
|
+
|-------|----------|-------------|
|
|
76
|
+
| `feature_id` | 是 | feature-manifest.yaml 中的 `FM-NNN` |
|
|
77
|
+
| `scenario` | 是 | `snake_case` 情境名稱(`happy_path`、`not_found` 等) |
|
|
78
|
+
| `request.method` | 是 | HTTP 方法 |
|
|
79
|
+
| `request.path` | 是 | 不含 base URL 的 URL 路徑 |
|
|
80
|
+
| `request.headers` | 否 | 請求所需的標頭(不含真實認證 token) |
|
|
81
|
+
| `request.body` | 否 | 請求主體(JSON) |
|
|
82
|
+
| `response.status` | 是 | 預期的 HTTP 狀態碼 |
|
|
83
|
+
| `response.body` | 是 | 預期的回應主體(比較用欄位) |
|
|
84
|
+
| `ignore_fields` | 否 | 比較時略過的欄位(詳見下方指南) |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 目錄結構
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
.snapshots/
|
|
92
|
+
FM-001-UserLogin/
|
|
93
|
+
happy_path.json
|
|
94
|
+
invalid_credentials.json
|
|
95
|
+
account_locked.json
|
|
96
|
+
FM-007-OrderCancellation/
|
|
97
|
+
happy_path.json
|
|
98
|
+
order_not_found.json
|
|
99
|
+
order_already_cancelled.json
|
|
100
|
+
MANUAL-refund_webhook.json ← 手動撰寫
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### MANUAL- 前綴
|
|
104
|
+
|
|
105
|
+
以 `MANUAL-` 為前綴的檔案包含無法自動錄製的快照:
|
|
106
|
+
- 由第三方觸發的 Webhook 端點
|
|
107
|
+
- 需要特定、難以重現的資料庫狀態的情境
|
|
108
|
+
- 背景工作 / 佇列觸發流程(非 HTTP 入口點)
|
|
109
|
+
|
|
110
|
+
`MANUAL-` 檔案不納入自動重放,但計入覆蓋率報告。
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## `ignore_fields` 使用指南
|
|
115
|
+
|
|
116
|
+
> **核心原則 —— 忽略「值」,保留「格式」斷言。** 某欄位是非確定性的,意指它的*值*在每次執行間會改變;這**並不**代表該欄位的*形狀*可以自由變動。`ignore_fields` 的天真用法會把整個欄位排除在比較之外,連帶也停止斷言其格式 —— 於是當序列化器悄悄把 ISO-8601 時間戳改成 Unix epoch、拿掉時區、或變更 UUID 大小寫/版本時,皆無人察覺。**忽略其值,但仍斷言其格式。**
|
|
117
|
+
|
|
118
|
+
### 忽略值 vs. 忽略格式
|
|
119
|
+
|
|
120
|
+
| 欄位 | 天真做法:整欄忽略 | 建議做法:忽略值、斷言格式 |
|
|
121
|
+
|-------|---------------------------|-------------------------------------------|
|
|
122
|
+
| `created_at` | 完全不比較 | 忽略其值;但仍斷言它是 ISO-8601、且維持相同的小數秒精度與相同的時區表示 |
|
|
123
|
+
| `trace_id` | 完全不比較 | 忽略其值;但仍斷言它符合 UUID 版本與標準 8-4-4-4-12 形狀 |
|
|
124
|
+
| `token` | 完全不比較 | 忽略其值;但仍斷言長度、字元集與前綴 |
|
|
125
|
+
|
|
126
|
+
### 非確定性欄位:忽略值、斷言格式
|
|
127
|
+
|
|
128
|
+
| 欄位模式 | 忽略(值) | 仍須斷言(格式/形狀) |
|
|
129
|
+
|--------------|--------------------|-------------------------------|
|
|
130
|
+
| `created_at`、`updated_at`、`timestamp` | 該瞬時 | ISO-8601 vs. epoch vs. 自訂;小數秒精度(位數);時區表示(`Z` vs `+00:00` vs 偏移量) |
|
|
131
|
+
| `token`、`session_id`、`csrf_token` | 隨機位元組 | 長度、字元集、前綴 |
|
|
132
|
+
| `request_id`、`trace_id`、`correlation_id` | 隨機 UUID | UUID 版本 + 標準 8-4-4-4-12 形狀與大小寫 |
|
|
133
|
+
|
|
134
|
+
**時間欄範例。** 某遷移後的端點回傳 `created_at`:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
舊系統:"2026-05-12T08:30:00Z"
|
|
138
|
+
新系統:"2026-05-12T08:30:00.000+00:00"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
兩者解碼後是同一瞬時,因此整欄忽略 —— 甚至是「先 parse 成日期再比值」 —— 都會通過。但**序列化格式已漂移**:多了小數秒、且時區表示從 `Z` 變成 `+00:00`。對採字串比對、或以嚴格格式 parse 的客戶端而言,這在正式環境會壞掉。斷言格式 pattern(例如 `^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$`)能抓到它;整欄忽略則會遮蔽它。
|
|
142
|
+
|
|
143
|
+
### 一律比較(業務邏輯)
|
|
144
|
+
|
|
145
|
+
| 欄位模式 | 原因 |
|
|
146
|
+
|--------------|--------|
|
|
147
|
+
| `status`、`code`、`message`、`error_code` | 核心業務結果 |
|
|
148
|
+
| `order_status`、`payment_status` | 狀態機結果 |
|
|
149
|
+
| `amount`、`quantity`、`price` | 計算後的業務數值 |
|
|
150
|
+
| `success`、`refunded`、`cancelled` | 布林業務結果 |
|
|
151
|
+
| `user_id`、`order_id`(搭配固定測試資料) | 參照完整性 |
|
|
152
|
+
|
|
153
|
+
### 整欄忽略(例外 —— 須附理由)
|
|
154
|
+
|
|
155
|
+
把欄位完全排除在比較之外 —— 既不比值、**也不**斷言格式 —— 是**例外**,非預設。僅在欄位格式確實未定義或無關緊要時保留此做法(例如不透明的廠商 blob),並在行內註明理由。
|
|
156
|
+
|
|
157
|
+
> ⚠️ **風險**:整欄忽略會遮蔽**格式漂移**。改變精度或時區的時間戳、改變版本的 UUID、或多了/少了一個尾零的數字都會悄悄通過 —— 而這正是一致性測試本應抓到的那類 bug。
|
|
158
|
+
|
|
159
|
+
**規則**:`ignore_fields` 僅用於確實不確定性的*值*。忽略其值的同時,仍須斷言該欄位的格式/形狀。用它來排除業務邏輯欄位 —— 或用它來消音非確定性欄位的格式漂移 —— 都會使一致性測試失去意義。
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 序列化格式對等
|
|
164
|
+
|
|
165
|
+
只比較**反序列化後物件**的差分 oracle,會悄悄把序列化層級的差異 normalize 掉:它把兩邊的回應都 parse 成 map/物件再比較,於是任何在 parse 後消失的分歧都看不見了。要抓到序列化 bug,oracle 必須以能保留序列化形式的粒度比較 —— 要嘛比對**原始序列化字串**,要嘛明確斷言 JSON 形狀。
|
|
166
|
+
|
|
167
|
+
### 比較反序列化物件會遮蔽什麼
|
|
168
|
+
|
|
169
|
+
| 序列化分歧 | 比較 parse 後物件時會被遮蔽嗎? |
|
|
170
|
+
|--------------------------|------------------------------------------|
|
|
171
|
+
| `1` vs `1.0`(數字格式) | 會 —— 兩者都 parse 成數字 `1` |
|
|
172
|
+
| `null` vs 缺少該 key | 會 —— 兩者都讀成不存在/null |
|
|
173
|
+
| `true` vs `1` vs `"true"` | 常會 —— 型別強制轉換後 |
|
|
174
|
+
| key 排序 | 會 —— 物件 key 無序 |
|
|
175
|
+
| 前導零/科學記號 | 會 —— parse 時被 normalize |
|
|
176
|
+
| 空白與 Unicode 轉義(`\/`、`\uXXXX`) | 會 —— parse 時遺失 |
|
|
177
|
+
|
|
178
|
+
### 兩種策略
|
|
179
|
+
|
|
180
|
+
1. **原始字串比對** —— 比對精確的序列化字串。保真度最強;當 wire 格式屬於契約一部分時採用(公開 API、被快取的 payload、簽章過的 body)。
|
|
181
|
+
2. **明確的 JSON 形狀斷言** —— 當原始比對太嚴格時(例如確實有非確定性的值),改為明確斷言形狀:
|
|
182
|
+
- **key 的存在性與順序**(當順序屬於契約時)
|
|
183
|
+
- **數字格式**:`1` vs `1.0`、前導零、科學記號
|
|
184
|
+
- **`null` vs 缺漏 key**(省略欄位不等於明確的 `null`)
|
|
185
|
+
- **布林/字串型別**:`true` vs `"true"` vs `1`
|
|
186
|
+
|
|
187
|
+
### 跨語言重寫會換掉序列化器
|
|
188
|
+
|
|
189
|
+
當系統以另一種語言重寫時,序列化器會換 —— 而各序列化器的**預設行為**不同。oracle 必須明確斷言這些,因為沒有其他東西會幫你抓。PHP `json_encode` ↔ C# `System.Text.Json` 常見的預設差異:
|
|
190
|
+
|
|
191
|
+
| 關注點 | PHP `json_encode`(預設) | C# `System.Text.Json`(預設) |
|
|
192
|
+
|---------|------------------------------|----------------------------------|
|
|
193
|
+
| 數字尾零 | `(float) 1.0` 輸出 `1`;需 `JSON_PRESERVE_ZERO_FRACTION` 才保留 `1.0` | `double` `1.0` 序列化成 `1`;`decimal` 保留小數位 |
|
|
194
|
+
| 日期/時間 | 無原生日期型別 —— 由應用決定(常是自訂字串或 epoch) | `DateTime`/`DateTimeOffset` → ISO-8601(round-trip "O"),例如 `2026-05-12T08:30:00+00:00` |
|
|
195
|
+
| 時區 | 由應用決定 | `DateTimeOffset` 保留偏移量;`DateTime.Kind` 決定 `Z` vs 偏移量 |
|
|
196
|
+
| `null` 屬性 | 以 `"k":null` 輸出 | 預設輸出;僅在 `DefaultIgnoreCondition.WhenWritingNull` 時省略 |
|
|
197
|
+
| key 排序 | 插入順序(associative array) | 屬性宣告/反射順序 |
|
|
198
|
+
| 斜線與 Unicode 轉義 | 預設轉義 `/` 與非 ASCII,除非設 `JSON_UNESCAPED_SLASHES` / `JSON_UNESCAPED_UNICODE` | 不轉義 `/`;非 ASCII 依所設定的 encoder 轉義 |
|
|
199
|
+
|
|
200
|
+
### 斷言序列化形狀(TypeScript)
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
// 超越值的對等:斷言序列化形式,而不只是 parse 後的物件。
|
|
204
|
+
function assertSerializationParity(oldRaw: string, newRaw: string): void {
|
|
205
|
+
// 1. 最強:精確的序列化字串(只剝除被忽略的*值*之後)。
|
|
206
|
+
if (oldRaw === newRaw) return;
|
|
207
|
+
|
|
208
|
+
// 2. 否則在原始文字上明確斷言形狀,而非在 JSON.parse() 上:
|
|
209
|
+
// 數字格式 —— 舊的 "1.0" 不可悄悄變成新的 "1"
|
|
210
|
+
const numberShape = (s: string) => s.match(/:\s*-?\d+(\.\d+)?([eE][+-]?\d+)?/g) ?? [];
|
|
211
|
+
expect(numberShape(newRaw)).toEqual(numberShape(oldRaw));
|
|
212
|
+
|
|
213
|
+
// null vs 缺漏 —— 明確的 "key":null 不可消失
|
|
214
|
+
expect(/"refund_id"\s*:\s*null/.test(newRaw))
|
|
215
|
+
.toBe(/"refund_id"\s*:\s*null/.test(oldRaw));
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## 一致性檢查工具
|
|
222
|
+
|
|
223
|
+
執行 `scripts/parity-check.ts` 對目標系統重放所有快照:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npx tsx scripts/parity-check.ts --url http://new-system:8080 [--snapshots .snapshots] [--env uat|staging]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### 輸出範例
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
🔄 Parity Check — 119 snapshots against http://new-system:8080
|
|
233
|
+
|
|
234
|
+
✅ FM-001 / happy_path
|
|
235
|
+
✅ FM-001 / invalid_credentials
|
|
236
|
+
❌ [PARITY-FAIL] FM-007 / happy_path
|
|
237
|
+
body.order_status: expected "cancelled", got "pending"
|
|
238
|
+
body.refund_initiated: expected true, got false
|
|
239
|
+
|
|
240
|
+
─────────────────────────────────
|
|
241
|
+
Parity Results: 118/119 passed (99.2%)
|
|
242
|
+
|
|
243
|
+
❌ 1 parity check(s) failed.
|
|
244
|
+
[PARITY-BLOCK] UAT/production deployment blocked. Fix parity failures first.
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### 結束碼
|
|
248
|
+
|
|
249
|
+
| 代碼 | 意義 |
|
|
250
|
+
|------|---------|
|
|
251
|
+
| 0 | 所有快照通過 |
|
|
252
|
+
| 1 | 發現失敗 + `--env uat` 或 `production` → 部署被阻擋 |
|
|
253
|
+
| 2 | 發現失敗 + `--env staging` → 僅警告 |
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Gate 0:特性化測試協議(重構)
|
|
258
|
+
|
|
259
|
+
在開始任何重構之前,特性化測試必須存在且通過。
|
|
260
|
+
|
|
261
|
+
### 什麼是特性化測試?
|
|
262
|
+
|
|
263
|
+
特性化測試記錄現有程式碼*實際的行為*——而非它*應有的行為*。它們在修改開始前鎖定可觀察的行為。若重構期間特性化測試失敗,代表行為發生了非預期的變更。
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
describe('characterization: OrderService.cancelOrder', () => {
|
|
267
|
+
// @characterization
|
|
268
|
+
it('returns status cancelled and sets refund_initiated=true for valid order', async () => {
|
|
269
|
+
const result = await orderService.cancelOrder('test-order-123', 'customer_request');
|
|
270
|
+
expect(result.order_status).toBe('cancelled');
|
|
271
|
+
expect(result.refund_initiated).toBe(true);
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Gate 0 強制執行
|
|
277
|
+
|
|
278
|
+
1. **第一次重構 commit 前**:執行 `npm test -- --grep characterization`
|
|
279
|
+
- 任何失敗 → 停止。先修復現有程式碼,再進行修改。
|
|
280
|
+
2. **重構期間**:每次 commit 重新執行特性化測試
|
|
281
|
+
- 任何失敗 → 立即警告行為偏移
|
|
282
|
+
3. **Gate 2(完成)**:所有特性化測試通過 → 重構完成
|
|
283
|
+
|
|
284
|
+
### 反模式警告
|
|
285
|
+
|
|
286
|
+
> 絕不要在沒有 Gate 0 的情況下開始重構。一旦開始修改程式碼,就無法判斷測試失敗究竟是「我破壞了某些東西」還是「測試對舊行為的描述有誤」。
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## 與遷移 Pipeline 整合
|
|
291
|
+
|
|
292
|
+
### Gate 1 預飛行(`--variant migration`)
|
|
293
|
+
|
|
294
|
+
在執行 `/vo-pipeline --variant migration` 之前:
|
|
295
|
+
1. `artifacts/feature-manifest.yaml` 必須存在
|
|
296
|
+
2. `.snapshots/` 必須包含每個功能至少一個快照
|
|
297
|
+
|
|
298
|
+
### 一致性閘門(UAT 前)
|
|
299
|
+
|
|
300
|
+
所有功能實作完成後,執行一致性檢查:
|
|
301
|
+
- 要求 100% 通過率(不含 `MANUAL-` 檔案)
|
|
302
|
+
- 任何失敗皆阻擋 UAT 晉升
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 反模式
|
|
307
|
+
|
|
308
|
+
| 反模式 | 影響 | 正確做法 |
|
|
309
|
+
|--------------|--------|------------------|
|
|
310
|
+
| 過度使用 `ignore_fields` | 隱藏業務邏輯差異 | 僅忽略非確定性欄位 |
|
|
311
|
+
| 跳過 MANUAL 快照 | Webhook/背景行為未測試 | UAT 前先撰寫 MANUAL 快照 |
|
|
312
|
+
| 從損壞的系統錄製快照 | 基準線錯誤 | 錄製前先驗證舊系統行為 |
|
|
313
|
+
| 只比較反序列化後的物件 | 序列化格式 bug(數字格式、`null` vs 缺漏 key、key 排序、型別強制轉換)在 parse 時被 normalize 掉 | 比對原始序列化字串,或明確斷言 JSON 形狀(見「序列化格式對等」) |
|
|
314
|
+
| 對非確定性欄位採整欄 `ignore_fields` | 遮蔽該欄位的**格式**漂移(時間戳精度/時區、UUID 版本) | 忽略其值但仍斷言格式/形狀(見「`ignore_fields` 使用指南」) |
|
|
315
|
+
| 特性化測試缺少 `@characterization` | Gate 0 找不到它們 | 一律加上 `@characterization` 標記 |
|
|
316
|
+
| 未進行 Gate 0 就開始重構 | 無法偵測行為偏移 | 先跑特性化測試,始終如此 |
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## 相關標準
|
|
321
|
+
|
|
322
|
+
- [功能清單標準](../../../core/feature-manifest-standard.md) — 功能清單中 FM-NNN 的 schema
|
|
323
|
+
- [驗收條件追蹤](../../../core/acceptance-criteria-traceability.md) — `not_implemented` AC 狀態
|
|
324
|
+
- [重構標準](../../../core/refactoring-standards.md) — 特性化測試需求
|
|
325
|
+
- [測試標準](../../../core/testing-standards.md) — 測試實作標準
|
|
326
|
+
- [資料遷移測試](../../../core/data-migration-testing.md) — 同樣的「別只比看起來相等」原則,作用於 DB 儲存層(byte/codepoint 編碼),而非 oracle/序列化層
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## 版本歷史
|
|
331
|
+
|
|
332
|
+
| 版本 | 日期 | 變更 |
|
|
333
|
+
|---------|------|---------|
|
|
334
|
+
| 1.0.0 | 2026-05-12 | 初始版本 — 快照 schema、一致性閘門、Gate 0 特性化協議(XSPEC-201) |
|
|
335
|
+
| 1.1.0 | 2026-06-28 | 比對保真度補強(XSPEC-306)— `ignore_fields` 改寫為「忽略值、斷言格式」;新增「序列化格式對等」章節(原始 vs. JSON 形狀斷言、PHP↔C# 序列化器預設);2 條格式遮蔽反模式;與 data-migration-testing 交叉引用 |
|