Feature request: opt-in DFMEA support across design, implementation, and verification

Đang mở
#2,191 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
8/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Lĩnh vực
tooling

Hướng nghiên cứu

This is a design proposal with no code to change yet. Start by reading the linked discussions #1720 and #783 and PR #893 to see which quality-review work can be reused. Then look at the built-in design.md schema section for [Risk] → Mitigation, which the proposal builds on. Done means maintainers agree on the storage format, scoring policy, and enforcement limits, not that a patch exists.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The problem

OpenSpec can describe intended behavior and check whether an implementation matches it, but its built-in workflow does not provide a structured way to analyze how a design could fail, prioritize those risks, and demonstrate that mitigation actions reduced them. A change can therefore satisfy its written requirements while failure modes omitted from those requirements remain unexamined.

Who this affects

Teams using OpenSpec for changes where failures have material consequences: data migrations, authorization, concurrent updates, external integrations, recovery, and cross-service behavior. The need spans agents and models; it comes from the design process rather than one assistant's behavior.

This request is based on repository and workflow review, not a claimed production incident or a measured defect-reduction study. It proposes an optional capability for teams that need it, without adding a risk-analysis exercise to every small change.

Alternatives you considered

  • Risks / Trade-offs in design.md: the built-in schema already asks for [Risk] → Mitigation. This is useful, but does not define a complete relationship between functions, failure modes, effects, causes, controls, actions, and reassessment.
  • Requirements and failure scenarios: these specify behavior we already know to ask for. A structured failure analysis helps discover missing requirements and challenge the design before implementation.
  • /opsx:verify: checks implementation against artifacts. It cannot establish that the artifacts cover the important ways the design could fail.
  • Custom schemas, instructions, or an external worksheet: these are viable starting points. Without shared conventions, teams must maintain their own risk-to-spec/task/test links, lifecycle rules, and evidence records. Whether a documented community schema is sufficient should be part of the design discussion.
  • Existing quality-review proposals: these cover important parts of the problem, but do not yet define an end-to-end DFMEA record. The proposal should reuse them rather than create a competing review system.

Why it's worth the added complexity

The value is traceability from a potential failure to a design change and evidence of its effectiveness. For example, an authorization failure identified during design should lead to an explicit rejection scenario, a prevention measure, a task, a test, and a reviewed residual-risk decision.

Costs include additional authoring and review time, model tokens, rating calibration, and stale analysis as the design evolves. Keep adoption explicit, allow teams to scope analysis to the affected design, and reuse existing artifact and review mechanisms. A team that does not enable DFMEA should receive no new required artifact, command, archive restriction, or model work.

What you have in mind

Support Design Failure Mode and Effects Analysis (DFMEA) as an optional part of specification-driven development, kept current as the design changes. "Complete" here means supporting the whole analysis-to-action-to-reassessment loop; it does not mean claiming exhaustive failure discovery or compliance with an industry standard.

1. Cover the full analysis lifecycle
Step What the change should capture
Planning and preparation Scope, affected capabilities, assumptions, operating conditions, review participants, boundaries, and exclusions.
Structure analysis Relevant components and interfaces, their relationships, external dependencies, and shared resources.
Function analysis What each element must do, applicable requirements, and the operating states in which the function matters.
Failure analysis How a function could fail, its effects on users and neighboring components, and the potential causes or triggering conditions. Keep mode, effect, and cause distinct.
Risk analysis Existing prevention and detection controls; severity, occurrence, and detection assessments with rationale and uncertainty; an explicit action-priority decision.
Optimization Actions that change the design or controls, an accountable owner, target date or milestone, implementation links, and effectiveness checks.
Results documentation Evidence, reassessment, residual-risk disposition, reviewer decisions, and a history of changes to the analysis.

Analysis should start while requirements and design can still change, then inform task planning. Findings discovered during implementation or verification must feed back into the same record. An early analysis can explicitly record unknowns and be refined as the design develops.

2. Use a readable, traceable risk record

The storage format is open for discussion: a schema-defined dfmea.md artifact, a structured section of design.md, or a community schema. Prefer the smallest representation that supports these relationships:

  • A stable risk ID and a defined function/component/interface.
  • Links to requirements and scenarios, including missing behavior that needs to be specified.
  • A failure mode, its local and downstream effects, and one or more cause-specific analysis entries.
  • Existing prevention controls, existing detection controls, and their supporting evidence.
  • Initial ratings, rationale, uncertainty, and the prioritization-policy version.
  • Recommended actions, owners, target dates or milestones, and linked tasks.
  • Effectiveness evidence, revised ratings, and a residual-risk decision with reviewer and date.

Different causes and controls may justify different occurrence or detection ratings. Do not collapse them into one unexplained score. Links should survive supported renames and moves, or be reported as unresolved; the exact identifier design should align with existing traceability work.

3. Make scoring explicit without false precision

Teams should define a versioned rubric for severity (S), occurrence (O), and detection (D), with examples appropriate to their domain. Under a conventional numeric rubric, higher D means poorer ability of current design-detection controls to detect the cause or failure mode early enough to correct the design before release or deployment. Runtime monitoring and recovery can be documented as controls, but must not be confused with pre-release design verification. For software, occurrence must identify the relevant cause, exposure, and operating conditions; model intuition is not a measured failure probability.

An agent may suggest failure chains, ratings, and actions, but proposed assessments must be distinguished from reviewer-confirmed ones. Missing data stays unknown, with an investigation action where needed. Do not default unknowns to low risk or calculate a misleading priority from incomplete inputs.

Prioritization should use the team's declared policy and keep high-severity concerns visible. A traditional RPN = S × O × D may be an optional view, but a low RPN alone must not imply acceptance. Support an explicit severity-aware action-priority policy. A project-defined policy must not be presented as the official AIAG/VDA Action Priority method; standards-based scoring would require an appropriate, separately agreed implementation.

Preserve the initial assessment alongside reassessment. Adding a test may improve detection; changing the design may reduce occurrence. Neither automatically reduces the severity of an unchanged effect. Each revised rating needs a reason and evidence.

4. Connect risks to implementation and evidence

For each actionable risk, carry mitigation behavior into the appropriate specs and scenarios, create or reference implementation tasks, and identify how control effectiveness will be checked. Evidence can be a regression test, fault-injection result, analysis, operational measurement, or documented human review; the evidence must address the specific claim.

Distinguish action implemented from effectiveness verified. A checked task, a named test file, or an entirely green suite is not by itself proof that a particular failure mode has been controlled.

Risk outcomes should remain explicit: open, action planned, implemented but unverified, verified with residual risk awaiting disposition, accepted residual risk, or reopened. Acceptance records the authorized reviewer, rationale, scope, and review trigger. The agent must not accept risk or assign obligations to people on its own. A justified "no additional action" disposition must also remain visible.

When requirements, interfaces, assumptions, or controls change, flag linked assessments for review. Preserve historical evidence but do not silently carry its validity forward. Archive should retain the analysis and evidence links without turning a change-specific decision into an unconditional product requirement; later changes can reference and revisit it.

5. Report coverage and enforcement limits

A report should distinguish applicable areas analyzed, intentionally excluded areas, unknowns, and areas not yet reviewed. Bounded AI review must report its unchecked remainder. No report should claim “all risks eliminated” because no issue was found.

For teams enabling DFMEA, risk readiness should be reported separately from artifact existence and task completion. Unknown assessments, unverified controls, and unresolved actions required by the selected policy must prevent a clean risk-readiness result. Recorded acceptance can satisfy the team's disposition policy without being mislabeled as "risk eliminated."

The initial proposal is advisory about workflow progression: it does not change archive behavior or execute project commands automatically. Optional CLI/CI enforcement, if agreed, must be explicit and reuse the quality-gate design discussion. A report saying "not ready" is not equivalent to a programmatically enforced gate.

Illustrative example: tenant isolation

This is a hypothetical example, not a reported OpenSpec defect. Ratings and acceptance are deliberately left pending domain review.

Field Example
Record ID DFMEA-001.
Function / requirement Return a requested record only to its authorized tenant.
Failure mode The API returns another tenant's record.
Effect Cross-tenant disclosure of confidential information.
Cause A repository lookup uses a record ID without tenant scoping.
Existing controls Authentication exists; evidence for tenant-level authorization is missing. Authentication alone does not establish isolation.
Initial assessment S/O/D pending rubric-based review; action priority unresolved.
Prevention action Require tenant-scoped access and define the expected rejection behavior in a linked requirement and scenario.
Detection action Exercise cross-tenant access attempts and assert that no protected data is returned; link the test and execution evidence.
Ownership and timing Reviewer-confirmed owner and target milestone before the action is considered planned.
Reassessment Re-evaluate cause occurrence and detection effectiveness from evidence; preserve severity unless the potential effect changes.
Disposition Keep open until evidence and residual-risk review satisfy the selected policy.
Relationship to existing discussions

These are related proposals, not assumed dependencies or already-shipped features. At drafting time, all remain open, including both PRs below.

Discussion Reuse opportunity and remaining gap
#1720: pre-generation spec quality gate Failure-path and recovery checks can discover modes. DFMEA additionally captures effects, causes, controls, actions, and reassessment.
#783: cross-artifact quality review / PR #893: refine Reuse consistency review and issue tracking. Add explicit failure chains and residual-risk disposition.
#1741: adversarial review / PR #1752: opt-in adversarial verify Reuse counterexample search and evidence classifications to challenge controls. DFMEA also needs analysis before implementation and persistent risk records.
#1142: schema-defined quality gates Potential execution/enforcement surface for agreed checks. Gates alone do not discover or prioritize design risks.
#1519: planning readiness Keep risk readiness distinct from "files exist."
#829: schema-driven artifact validation Potential structural validation for risk records. Structural validity must not be presented as evidence of control effectiveness.
Suggested delivery boundary and acceptance criteria

Start with an opt-in schema/template and guidance that support the entire loop manually, plus one worked software example. This makes the method testable without first requiring a new command, scoring engine, or changes to archive. Decide whether that belongs in core or the community schema catalog before implementation.

If the concept is accepted, subsequent work can add structural validation, reference checking, and verification integration in coordination with the related issues. Optional automated enforcement would be a separate decision.

  • A team can trace an affected function through failure mode, effect, cause, controls, actions, evidence, and residual-risk disposition.
  • The worked example includes an initially unknown assessment, a mitigation, an effectiveness check, and a documented reassessment without fabricated ratings.
  • Initial and revised ratings use an identified rubric, retain their rationale, and distinguish AI suggestions from confirmed decisions.
  • Required actions have owners and targets; completing a task alone cannot mark its control effective.
  • Unknown, unverified, excluded, and unchecked areas remain visible in reports; unresolved required items cannot yield a clean risk-readiness result.
  • Changed assumptions or linked design behavior trigger explicit reassessment, and records remain available after archive.
  • Teams that do not opt in retain existing workflow behavior and cost. Enabled teams can bound scope without implying exhaustive analysis.
  • Documentation distinguishes the proposed workflow from standards compliance and from automatic CLI enforcement.
Questions for maintainers
  1. Does the problem fit OpenSpec's scope, or should a community DFMEA schema remain the primary integration point?
  2. Would a separate schema artifact or a structured design section provide the best balance of traceability and maintenance cost?
  3. Should analysis and evidence review extend the existing planning/verify flows rather than introduce another skill?
  4. Is an advisory first iteration acceptable, with executable gates discussed separately under #1142?
Method references

Drafted with assistance from OpenAI Codex for contributor review. This is a request to discuss the problem and scope, not a claim that the design has been approved or implemented.

Ngôn ngữ chính
TypeScript
Star
76k
Fork
5.2k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
58

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Fission-AI/OpenSpec

Tất cả issue của Fission-AI/OpenSpec

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.