Skip to content

Commit b72d866

Browse files
aborjiginLeStarchbocchinothomas-bc
authored
Generative AI documentation Added (#3932)
* fixing error #3897 * Generative AI documentation added * Update GENERATIVE_AI.md * Update GENERATIVE_AI.md * Update pull_request_template.md resolving comments * Update OsTime.cpp resolving comment * updating expect.txt to have "GPT" * Update GENERATIVE_AI.md Co-authored-by: Rob Bocchino <[email protected]> * Fix relative link and display * updates to GENERATIVE_AI.md * Fix merge * Update GENERATIVE_AI.md * Update cross-compilation.md * reverting back to AI b/c branch confusion * updating disclosure and file name * Update to current in fprime devel * Fix relative link and display --------- Co-authored-by: M Starch <[email protected]> Co-authored-by: Rob Bocchino <[email protected]> Co-authored-by: Thomas Boyer-Chammard <[email protected]>
1 parent 4deda3d commit b72d866

File tree

3 files changed

+94
-4
lines changed

3 files changed

+94
-4
lines changed

.github/actions/spelling/expect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ gtest
279279
gtimeout
280280
Guire
281281
GVCID
282+
GPT
282283
HACKSM
283284
Handcoded
284285
handleflags

.github/pull_request_template.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,25 @@
33
|**_Related Issue(s)_**| |
44
|**_Has Unit Tests (y/n)_**| |
55
|**_Documentation Included (y/n)_**| |
6+
|**_Generative AI was used in this contribution (y/n)_**| |
67

78
---
89
## Change Description
910

10-
A description of the changes contained in the PR.
11+
<!-- A description of the changes contained in the PR. -->
1112

1213
## Rationale
1314

14-
A rationale for this change. e.g. fixes bug, or most projects need XYZ feature.
15+
<!-- A rationale for this change. e.g. fixes bug, or most projects need XYZ feature. -->
1516

1617
## Testing/Review Recommendations
1718

18-
Fill in testing procedures, specific items to focus on for review, or other info to help the team verify these changes are flight-quality.
19+
<!-- Fill in testing procedures, specific items to focus on for review, or other info to help the team verify these changes are flight-quality. -->
1920

2021
## Future Work
2122

22-
Note any additional work that will be done relating to this issue.
23+
<!-- Note any additional work that will be done relating to this issue. -->
24+
25+
## AI Usage ([policy](../AI_POLICY.md))
26+
27+
<!-- If AI was used, please describe how it was utilized (e.g., code generation, documentation, testing, debugging assistance, etc.). -->

AI_POLICY.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# F´ Generative AI Usage Guidelines
2+
3+
We're excited about the potential of generative AI to help make [](https://github.com/nasa/fprime) development more productive, enjoyable, and accessible! Whether you're using AI to write code, improve documentation, or learn about complex systems, we welcome the thoughtful use of these powerful tools in your F´ contributions.
4+
5+
This guide shares our community's approach to using generative AI effectively and responsibly. You'll find practical tips, best practices, and simple guidelines to help you get the most out of AI tools while maintaining the quality standards that make F´ great.
6+
7+
## Our Position on Generative AI
8+
9+
F´ embraces technological advancement and innovation. Generative AI tools can assist with:
10+
11+
- Code generation and refactoring
12+
- Documentation creation and improvement
13+
- Test case development
14+
- Debugging assistance
15+
- Design pattern suggestions
16+
- Learning and understanding our codebases
17+
18+
However, the use of generative AI must align with our commitment to high technical standards, quality, and the collaborative nature of open source development.
19+
20+
## Disclosure
21+
22+
To maintain transparency and enable effective code review, contributors **must disclose all generative AI usage**.
23+
This includes contributions in the forms of **Pull Requests**, **Issues** or **Discussions**.
24+
25+
### Pull Request Submissions for Contributors
26+
27+
1. **Fill-In the "AI Used (y/n)" table entry** in the pull request template disclosing whether Gen AI was used in the pull request
28+
2. **Provide details in the "AI Usage" section** describing how generative AI was utilized
29+
30+
### What to Disclose
31+
32+
Include information about:
33+
34+
- **Type of assistance**: Code generation, documentation, debugging, testing, refactoring, etc.
35+
- **Scope of usage**: Which files, functions, or sections were AI-assisted
36+
- **Tool(s) used**: Name of the AI system(s) employed (e.g., GitHub Copilot, ChatGPT, etc.)
37+
- **Level of modification**: Whether AI-generated content was used as-is, modified, or used as inspiration
38+
39+
40+
### What AI Cannot Replace
41+
42+
- **Domain expertise** in flight software and embedded systems
43+
- **Understanding of F Prime architecture** and design patterns
44+
- **Critical thinking** about system requirements and constraints
45+
- **Human judgment** on safety-critical decisions
46+
- **Community collaboration** and peer review processes
47+
48+
## Best Practices
49+
50+
### Providing Guidelines to AI Tools
51+
52+
When working with generative AI, provide clear rules and context to improve code quality and consistency. For Example:
53+
54+
- **Reference F´ Style Guidelines**: Include the [F´ Style Guidelines](https://github.com/nasa/fprime/wiki/F%C2%B4-Style-Guidelines) in your prompts
55+
- **Enforce coding standards**: Instruct AI to avoid "magic numbers" and use descriptive variable names or comments
56+
- **Provide project context**: Share relevant F´ architectural patterns and component structures
57+
58+
### Quality and Responsibility
59+
60+
- **Review all AI-generated code** thoroughly before submission
61+
- **Verify necessity and relevance** - Remove verbose or unnecessary AI-generated content
62+
- **Be concise** - Edit AI output to be clear and to-the-point
63+
- **Ensure compliance** with F Prime coding standards and style guidelines
64+
- **Verify correctness** and test all AI-assisted implementations
65+
- **Maintain authorship responsibility** - you are accountable for all submitted code regardless of its origin
66+
67+
### Security
68+
69+
- **Be cautious with external dependencies** suggested by AI tools
70+
- **Validate security implications** of AI-generated code, especially for flight software
71+
72+
### Code Review Considerations
73+
74+
- **Provide context** to reviewers about AI usage to enable informed evaluation
75+
- **Be prepared to explain** AI-generated logic and design decisions
76+
- **Accept feedback gracefully** - AI-generated code is not exempt from revision requests
77+
- **Document complex AI-assisted algorithms** clearly for future maintainers
78+
79+
## Getting Help
80+
81+
If you have questions about appropriate AI usage or need guidance on disclosure:
82+
83+
- Open a [Discussion](https://github.com/nasa/fprime/discussions) for community input
84+
- Contact the Community Managers for specific guidance

0 commit comments

Comments
 (0)