Skip to content

Commit e0ac388

Browse files
Claude/review scm security cn f lt (#9)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent ca23d9a commit e0ac388

File tree

18 files changed

+1656
-64
lines changed

18 files changed

+1656
-64
lines changed

.credo.exs

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Credo Configuration
2+
#
3+
# Strict configuration for Valence Shell.
4+
# Run with: mix credo --strict
5+
6+
%{
7+
configs: [
8+
%{
9+
name: "default",
10+
files: %{
11+
included: [
12+
"lib/",
13+
"test/"
14+
],
15+
excluded: [
16+
~r"/_build/",
17+
~r"/deps/",
18+
~r"/priv/",
19+
~r"/proofs/"
20+
]
21+
},
22+
plugins: [],
23+
requires: [],
24+
strict: true,
25+
parse_timeout: 5000,
26+
color: true,
27+
checks: %{
28+
enabled: [
29+
# Consistency
30+
{Credo.Check.Consistency.ExceptionNames, []},
31+
{Credo.Check.Consistency.LineEndings, []},
32+
{Credo.Check.Consistency.ParameterPatternMatching, []},
33+
{Credo.Check.Consistency.SpaceAroundOperators, []},
34+
{Credo.Check.Consistency.SpaceInParentheses, []},
35+
{Credo.Check.Consistency.TabsOrSpaces, []},
36+
37+
# Design
38+
{Credo.Check.Design.AliasUsage, [priority: :low, if_nested_deeper_than: 2]},
39+
{Credo.Check.Design.DuplicatedCode, [priority: :normal]},
40+
{Credo.Check.Design.TagTODO, [exit_status: 0]}, # Warn but don't fail
41+
{Credo.Check.Design.TagFIXME, []},
42+
43+
# Readability
44+
{Credo.Check.Readability.AliasOrder, []},
45+
{Credo.Check.Readability.FunctionNames, []},
46+
{Credo.Check.Readability.LargeNumbers, []},
47+
{Credo.Check.Readability.MaxLineLength, [priority: :low, max_length: 120]},
48+
{Credo.Check.Readability.ModuleAttributeNames, []},
49+
{Credo.Check.Readability.ModuleDoc, []},
50+
{Credo.Check.Readability.ModuleNames, []},
51+
{Credo.Check.Readability.ParenthesesInCondition, []},
52+
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
53+
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
54+
{Credo.Check.Readability.PredicateFunctionNames, []},
55+
{Credo.Check.Readability.PreferImplicitTry, []},
56+
{Credo.Check.Readability.RedundantBlankLines, []},
57+
{Credo.Check.Readability.Semicolons, []},
58+
{Credo.Check.Readability.SpaceAfterCommas, []},
59+
{Credo.Check.Readability.StringSigils, []},
60+
{Credo.Check.Readability.TrailingBlankLine, []},
61+
{Credo.Check.Readability.TrailingWhiteSpace, []},
62+
{Credo.Check.Readability.UnnecessaryAliasExpansion, []},
63+
{Credo.Check.Readability.VariableNames, []},
64+
{Credo.Check.Readability.WithSingleClause, []},
65+
66+
# Refactoring
67+
{Credo.Check.Refactor.Apply, []},
68+
{Credo.Check.Refactor.CondStatements, []},
69+
{Credo.Check.Refactor.CyclomaticComplexity, [max_complexity: 10]},
70+
{Credo.Check.Refactor.FunctionArity, [max_arity: 6]},
71+
{Credo.Check.Refactor.LongQuoteBlocks, []},
72+
{Credo.Check.Refactor.MatchInCondition, []},
73+
{Credo.Check.Refactor.MapJoin, []},
74+
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
75+
{Credo.Check.Refactor.NegatedConditionsWithElse, []},
76+
{Credo.Check.Refactor.Nesting, [max_nesting: 3]},
77+
{Credo.Check.Refactor.UnlessWithElse, []},
78+
{Credo.Check.Refactor.WithClauses, []},
79+
80+
# Warnings
81+
{Credo.Check.Warning.BoolOperationOnSameValues, []},
82+
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
83+
{Credo.Check.Warning.IExPry, []},
84+
{Credo.Check.Warning.IoInspect, []},
85+
{Credo.Check.Warning.OperationOnSameValues, []},
86+
{Credo.Check.Warning.OperationWithConstantResult, []},
87+
{Credo.Check.Warning.RaiseInsideRescue, []},
88+
{Credo.Check.Warning.SpecWithStruct, []},
89+
{Credo.Check.Warning.UnusedEnumOperation, []},
90+
{Credo.Check.Warning.UnusedFileOperation, []},
91+
{Credo.Check.Warning.UnusedKeywordOperation, []},
92+
{Credo.Check.Warning.UnusedListOperation, []},
93+
{Credo.Check.Warning.UnusedPathOperation, []},
94+
{Credo.Check.Warning.UnusedRegexOperation, []},
95+
{Credo.Check.Warning.UnusedStringOperation, []},
96+
{Credo.Check.Warning.UnusedTupleOperation, []},
97+
{Credo.Check.Warning.UnsafeExec, []}
98+
],
99+
disabled: [
100+
# These are optional extras
101+
{Credo.Check.Readability.StrictModuleLayout, []},
102+
{Credo.Check.Refactor.ABCSize, []},
103+
{Credo.Check.Refactor.AppendSingleItem, []},
104+
{Credo.Check.Refactor.DoubleBooleanNegation, []},
105+
{Credo.Check.Refactor.ModuleDependencies, []},
106+
{Credo.Check.Refactor.NegatedIsNil, []},
107+
{Credo.Check.Refactor.PipeChainStart, []},
108+
{Credo.Check.Refactor.VariableRebinding, []},
109+
{Credo.Check.Warning.LazyLogging, []},
110+
{Credo.Check.Warning.LeakyEnvironment, []},
111+
{Credo.Check.Warning.MapGetUnsafePass, []},
112+
{Credo.Check.Warning.MixEnv, []},
113+
{Credo.Check.Warning.UnsafeToAtom, []}
114+
]
115+
}
116+
}
117+
]
118+
}
Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
11
---
2-
name: Bug report
3-
about: Create a report to help us improve
4-
title: "[Bug]: "
5-
labels: 'bug, priority: unset, triage'
2+
name: Bug Report
3+
about: Report a bug in Valence Shell
4+
title: '[BUG] '
5+
labels: bug
66
assignees: ''
7-
87
---
98

10-
**Describe the bug**
11-
A clear and concise description of what the bug is.
9+
## Bug Description
10+
11+
<!-- A clear description of what the bug is -->
12+
13+
## To Reproduce
14+
15+
Steps to reproduce:
16+
1.
17+
2.
18+
3.
19+
20+
## Expected Behavior
21+
22+
<!-- What you expected to happen -->
23+
24+
## Actual Behavior
25+
26+
<!-- What actually happened -->
27+
28+
## Environment
29+
30+
- OS:
31+
- Elixir version:
32+
- Erlang/OTP version:
33+
- Valence Shell version:
1234

13-
**To Reproduce**
14-
Steps to reproduce the behavior:
15-
1. Go to '...'
16-
2. Click on '....'
17-
3. Scroll down to '....'
18-
4. See error
35+
## Logs/Error Messages
1936

20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
37+
\`\`\`
38+
<!-- Paste any relevant logs or error messages -->
39+
\`\`\`
2240

23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
41+
## Additional Context
2542

26-
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
43+
<!-- Any other context about the problem -->
3044

31-
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
45+
## Checklist
3646

37-
**Additional context**
38-
Add any other context about the problem here.
47+
- [ ] I have searched existing issues for duplicates
48+
- [ ] I have provided reproduction steps
49+
- [ ] I have included version information
Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
---
2-
name: Feature request
3-
about: Suggest an idea for this project
4-
title: ''
5-
labels: 'enhancement, priority: unset, triage'
2+
name: Feature Request
3+
about: Suggest a new feature for Valence Shell
4+
title: '[FEATURE] '
5+
labels: enhancement
66
assignees: ''
7-
87
---
98

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
## Feature Description
10+
11+
<!-- Clear description of the feature you'd like -->
12+
13+
## Use Case
14+
15+
<!-- Why is this feature needed? What problem does it solve? -->
16+
17+
## Proposed Solution
18+
19+
<!-- How do you think this should work? -->
20+
21+
## Alternatives Considered
22+
23+
<!-- Any alternative solutions you've considered -->
24+
25+
## Reversibility Considerations
26+
27+
<!-- For shell commands: How would this operation be reversed? -->
28+
29+
- Can this operation be undone?
30+
- What state needs to be captured for compensation?
31+
- Any edge cases for reversibility?
32+
33+
## Additional Context
1234

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
35+
<!-- Any other context, mockups, or examples -->
1536

16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
37+
## Checklist
1838

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
39+
- [ ] I have searched existing issues for duplicates
40+
- [ ] I have considered reversibility implications
41+
- [ ] This aligns with the project's goals (reversible, POSIX-compatible shell)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Proof Request
3+
about: Request a new formal proof or verification
4+
title: '[PROOF] '
5+
labels: formal-verification
6+
assignees: ''
7+
---
8+
9+
## Theorem Description
10+
11+
<!-- What property needs to be proven? -->
12+
13+
## Formal Statement
14+
15+
<!-- If possible, provide a formal statement in Coq/Lean/Agda syntax -->
16+
17+
```coq
18+
(* Example: *)
19+
Theorem new_property :
20+
forall x, P(x) -> Q(x).
21+
```
22+
23+
## Motivation
24+
25+
<!-- Why is this proof important? What does it guarantee? -->
26+
27+
## Scope
28+
29+
- [ ] Core reversibility property
30+
- [ ] Composition theorem
31+
- [ ] Independence/non-interference
32+
- [ ] Error handling correctness
33+
- [ ] Other:
34+
35+
## Target Proof Systems
36+
37+
<!-- Which systems should this be proven in? -->
38+
39+
- [ ] Coq (required)
40+
- [ ] Lean 4
41+
- [ ] Agda
42+
- [ ] Isabelle/HOL
43+
- [ ] Mizar
44+
- [ ] Z3 (SMT)
45+
46+
## Prerequisites
47+
48+
<!-- Any existing theorems this depends on -->
49+
50+
## Additional Context
51+
52+
<!-- References, related work, etc. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Summary
2+
3+
<!-- Brief description of what this PR does -->
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix (non-breaking change fixing an issue)
8+
- [ ] New feature (non-breaking change adding functionality)
9+
- [ ] Breaking change (fix or feature causing existing functionality to change)
10+
- [ ] Documentation update
11+
- [ ] Proof addition/modification
12+
- [ ] Refactoring (no functional changes)
13+
14+
## Checklist
15+
16+
### Code Quality
17+
- [ ] Code follows the project style guidelines (`mix format`)
18+
- [ ] Credo passes without errors (`mix credo --strict`)
19+
- [ ] Tests pass (`mix test`)
20+
- [ ] New code has appropriate tests
21+
22+
### Reversibility (for command implementations)
23+
- [ ] Implements `Valence.Command` behaviour
24+
- [ ] `execute/2` returns proper compensation
25+
- [ ] `compensate/2` correctly reverses the operation
26+
- [ ] `verify/1` detects drift
27+
28+
### Formal Verification (if modifying proofs)
29+
- [ ] Coq proofs compile (`just prove`)
30+
- [ ] No new `Admitted` or `sorry`
31+
- [ ] Cross-validation in at least 2 proof systems
32+
33+
### Documentation
34+
- [ ] README updated (if needed)
35+
- [ ] CHANGELOG updated
36+
- [ ] Docstrings added for new public functions
37+
38+
### Sacred Files
39+
- [ ] I have NOT modified sacred files (README.adoc, STATE.adoc, ARCHITECTURE.md, META.scm) without explicit approval
40+
41+
## Related Issues
42+
43+
<!-- Link any related issues: Fixes #123, Relates to #456 -->
44+
45+
## Testing
46+
47+
<!-- Describe how you tested this change -->
48+
49+
## Screenshots (if applicable)
50+
51+
<!-- Add screenshots for UI changes -->

0 commit comments

Comments
 (0)