Skip to content

Commit b124914

Browse files
committed
"Semantic cleanup: Remove academic bullshit, preserve technical value"
1 parent 959d005 commit b124914

89 files changed

Lines changed: 3349 additions & 32348 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor-rules

Lines changed: 12 additions & 2151 deletions
Large diffs are not rendered by default.
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
# Applied Verification Principle - Anti-Hallucination Rule
2+
3+
**CRITICAL**: Never fake, assume, or hallucinate results. Always verify what actually works. Use mocks ONLY when explicitly needed for testing isolated components.
4+
5+
## Core Principle
6+
7+
**"Verify Everything - Fake Nothing - Know What's Real"**
8+
9+
Every claim about functionality must be backed by actual verification. No assumptions, no optimistic assertions, no "it should work" statements.
10+
11+
## Mandatory Verification Requirements
12+
13+
### 1. **Code Must Actually Work**
14+
**BEFORE claiming any code works**:
15+
```python
16+
# REQUIRED: Actual verification
17+
def test_function_actually_works():
18+
result = my_function(test_input)
19+
assert result == expected_output # VERIFY the actual result
20+
21+
# FORBIDDEN: Assumed functionality
22+
def test_function_should_work():
23+
# Assuming this works without testing
24+
assert True # HALLUCINATION - DELETE THIS
25+
```
26+
27+
### 2. **Test Results Must Be Real**
28+
**NEVER fake test results**:
29+
```python
30+
# GOOD: Real test of real functionality
31+
def test_import_fix_actually_fixes_imports():
32+
broken_file = create_file_with_broken_imports()
33+
result = fix_imports(broken_file)
34+
verify_imports_actually_work(broken_file) # REAL VERIFICATION
35+
36+
# BAD: Fake test that passes without testing anything real
37+
def test_import_fix_works():
38+
return True # HALLUCINATION - This tests nothing
39+
```
40+
41+
### 3. **Documentation Must Match Reality**
42+
```markdown
43+
# GOOD: Accurate documentation
44+
## Code Generator
45+
- Generates Python functions that compile and run
46+
- VERIFIED: Tested with 50+ real examples
47+
- VERIFIED: Generated code passes all tests
48+
49+
# BAD: Hallucinated documentation
50+
## Code Generator
51+
- Uses advanced AI to generate perfect code
52+
- UNVERIFIED CLAIM - How do you know it's "perfect"?
53+
```
54+
55+
## Anti-Hallucination Mechanisms
56+
57+
### **Before Any Success Claim**
58+
1. **RUN THE CODE**: Execute it with real inputs
59+
2. **CHECK THE OUTPUTS**: Verify they match expectations
60+
3. **TEST EDGE CASES**: Ensure it works in realistic scenarios
61+
4. **DOCUMENT WHAT BROKE**: Be honest about limitations
62+
63+
### **Test Verification Standards**
64+
```python
65+
# EXCELLENT: Tests real working functionality
66+
class TestCodeGeneration:
67+
def test_generates_working_python_function(self):
68+
# 1. Generate actual code
69+
generated_code = generator.create_function("add_numbers", ["a", "b"])
70+
71+
# 2. Save to real file
72+
with open("test_function.py", "w") as f:
73+
f.write(generated_code)
74+
75+
# 3. Import and test it actually works
76+
import test_function
77+
result = test_function.add_numbers(2, 3)
78+
assert result == 5 # REAL VERIFICATION
79+
80+
def test_handles_invalid_input_gracefully(self):
81+
# Test real error handling, not assumed behavior
82+
with pytest.raises(ValueError):
83+
generator.create_function("", []) # ACTUAL ERROR TEST
84+
85+
# TERRIBLE: Fake tests that verify nothing
86+
class TestCodeGeneration:
87+
def test_code_generation_works(self):
88+
assert True # HALLUCINATION - DELETE
89+
90+
def test_handles_all_edge_cases(self):
91+
# Assuming it works without testing
92+
assert generator.is_robust == True # FAKE PROPERTY
93+
```
94+
95+
### **Explicit Mock Usage ONLY**
96+
**Mocks are allowed ONLY when**:
97+
1. **Testing in isolation**: Testing one component without external dependencies
98+
2. **Explicitly labeled**: Clear comments explaining why mocking is needed
99+
3. **Testing real interfaces**: Mock represents real external system behavior
100+
101+
```python
102+
# GOOD: Explicit mock for external dependency
103+
@patch('requests.get') # EXPLICIT MOCK
104+
def test_api_client_handles_timeout(self, mock_get):
105+
"""Test API client timeout handling - mocking external HTTP request."""
106+
mock_get.side_effect = requests.Timeout()
107+
108+
client = APIClient()
109+
with pytest.raises(TimeoutError):
110+
client.fetch_data() # Testing OUR error handling logic
111+
112+
# BAD: Mock to avoid implementing real functionality
113+
@patch('my_function') # AVOIDING REAL IMPLEMENTATION
114+
def test_my_function_works(self, mock_func):
115+
mock_func.return_value = "success"
116+
assert my_function() == "success" # Testing the mock, not reality
117+
```
118+
119+
## Verification Workflows
120+
121+
### **Feature Development Verification**
122+
1. **Write failing test**: Test describes what should work
123+
2. **Implement minimum code**: Make the test pass with real implementation
124+
3. **Verify manually**: Run the feature by hand to confirm it works
125+
4. **Test edge cases**: What happens when things go wrong?
126+
5. **Document limitations**: Be honest about what doesn't work yet
127+
128+
### **Bug Fix Verification**
129+
1. **Reproduce the bug**: Create test that demonstrates the failure
130+
2. **Fix the bug**: Change code to make test pass
131+
3. **Verify fix works**: Test the actual user scenario
132+
4. **Prevent regression**: Keep the test to catch future breaks
133+
134+
### **Integration Verification**
135+
1. **Test real workflows**: End-to-end user scenarios
136+
2. **Use real data**: Not fake test data that's too clean
137+
3. **Test on target platform**: Windows/Linux/whatever users actually use
138+
4. **Measure actual performance**: Don't assume it's "fast enough"
139+
140+
## Anti-Hallucination Checklist
141+
142+
### **Before Claiming Success**
143+
- [ ] Code actually compiles and runs
144+
- [ ] Tests pass with real implementation (not mocks)
145+
- [ ] Manually verified the functionality works
146+
- [ ] Tested with realistic inputs and edge cases
147+
- [ ] Documented actual limitations and known issues
148+
149+
### **Before Submitting Code**
150+
- [ ] All tests use real functionality
151+
- [ ] Mocks are explicitly labeled and justified
152+
- [ ] Performance claims are measured, not assumed
153+
- [ ] Documentation matches actual implementation
154+
- [ ] Error handling is tested with real error scenarios
155+
156+
### **Red Flags (DELETE IMMEDIATELY)**
157+
- ❌ Tests that pass without testing real functionality
158+
- ❌ "It should work" statements without verification
159+
- ❌ Mocks used to avoid implementing real features
160+
- ❌ Claims about performance without measurement
161+
- ❌ Documentation that describes ideal behavior, not actual behavior
162+
163+
## Benefits
164+
165+
1. **Reliable Software**: Only ship what actually works
166+
2. **Honest Progress**: Know exactly what's implemented vs. planned
167+
3. **Better Debugging**: Real tests catch real problems
168+
4. **User Trust**: Software behaves as documented
169+
5. **Developer Confidence**: Team knows what's real vs. aspirational
170+
171+
## Examples
172+
173+
### **GOOD: Applied Verification**
174+
```python
175+
def test_file_organization_actually_works():
176+
"""Verify file organization moves files to correct locations."""
177+
# 1. Create test files in wrong locations
178+
create_file("test_utils.py", content="def helper(): pass")
179+
create_file("test_agent.py", content="class Agent: pass")
180+
181+
# 2. Run file organization
182+
organizer.organize_project()
183+
184+
# 3. Verify files actually moved
185+
assert os.path.exists("utils/test_utils.py")
186+
assert os.path.exists("agents/test_agent.py")
187+
assert not os.path.exists("test_utils.py") # REAL VERIFICATION
188+
```
189+
190+
### **BAD: Hallucinated Testing**
191+
```python
192+
def test_file_organization_works():
193+
"""Test that file organization is working."""
194+
organizer = FileOrganizer()
195+
assert organizer.is_working == True # FAKE PROPERTY
196+
assert organizer.organizes_files() == "success" # UNVERIFIED CLAIM
197+
```
198+
199+
## Remember
200+
201+
**"Never trust, always verify."**
202+
203+
**"Mocks test our code, not our assumptions."**
204+
205+
**"If you can't demo it working, don't claim it works."**
206+
207+
**"Real tests catch real bugs. Fake tests give fake confidence."**
208+
209+
This principle prevents hallucination by requiring actual verification of every claim we make about our code.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Iron Principle: No Bullshit - Working Code Only
2+
3+
**CRITICAL**: We build ONLY what produces working code that serves real users. Zero tolerance for show-off concepts, philosophical abstractions, or theoretical implementations that don't deliver practical value.
4+
5+
## Core Principle
6+
7+
**"Working Code That Serves Humanity - Nothing Else"**
8+
9+
Every line of code, every class, every function, every test must have a clear, practical purpose that helps real developers accomplish real tasks. No exceptions.
10+
11+
## Mandatory Requirements
12+
13+
### 1. **Real User Value Test**
14+
Before creating ANY code component, answer:
15+
- What specific problem does this solve for a real user?
16+
- How does this help developers build better software faster?
17+
- Can I demonstrate this working in under 30 seconds?
18+
19+
If you can't answer these clearly, **DON'T BUILD IT**.
20+
21+
### 2. **No Abstract Concepts**
22+
**FORBIDDEN**:
23+
- "Mathematical foundations" without clear practical application
24+
- "Philosophical frameworks" that don't translate to working features
25+
- "Divine constants" or other abstract concepts
26+
- "Harmonic integration" or theoretical validations
27+
- Complex inheritance hierarchies that serve no user need
28+
29+
**REQUIRED**:
30+
- Simple, direct implementations that solve specific problems
31+
- Clear function names that describe exactly what they do
32+
- Immediate practical value for developers
33+
34+
### 3. **Working Code Over Theory**
35+
**ALWAYS CHOOSE**:
36+
- ✅ A simple function that works over complex architecture
37+
- ✅ Direct implementation over abstraction layers
38+
- ✅ Practical validation over theoretical verification
39+
- ✅ User-facing features over internal frameworks
40+
- ✅ Clear, readable code over clever algorithms
41+
42+
### 4. **Delete Ruthlessly**
43+
If any code exists that:
44+
- Doesn't serve a clear user need
45+
- Hasn't been used in 30 days
46+
- Is overly complex for its purpose
47+
- Exists "for future extensibility" without current need
48+
49+
**DELETE IT IMMEDIATELY**. No exceptions.
50+
51+
## Implementation Standards
52+
53+
### Code Creation
54+
```python
55+
# GOOD: Clear purpose, immediate value
56+
def fix_import_errors(file_path: str) -> List[str]:
57+
"""Fix common import errors in Python files. Returns list of fixes applied."""
58+
# Direct implementation that helps developers
59+
60+
# BAD: Abstract concepts without clear user value
61+
class UniversalPhilosophicalFramework:
62+
"""Abstract framework for theoretical validation."""
63+
# This serves no real user - DELETE IT
64+
```
65+
66+
### Test Creation
67+
```python
68+
# GOOD: Tests real functionality users depend on
69+
def test_code_generation_produces_working_code():
70+
"""Verify generated code actually compiles and runs."""
71+
72+
# BAD: Tests abstract concepts
73+
def test_harmonic_integration_mathematical_properties():
74+
"""Test theoretical mathematical relationships."""
75+
# DELETE - no user cares about this
76+
```
77+
78+
### Documentation
79+
```markdown
80+
# GOOD: Clear instructions for real tasks
81+
## How to Generate Working Python Code
82+
1. Call agent.generate_code(requirements)
83+
2. Code is automatically tested and validated
84+
3. Working code is saved to your project
85+
86+
# BAD: Abstract philosophical explanations
87+
## Harmonic Integration of Divine Mathematical Constants
88+
Complex theoretical framework for validating...
89+
DELETE THIS BULLSHIT
90+
```
91+
92+
## Enforcement Mechanisms
93+
94+
### **Before Any Development**
95+
1. **User Story Test**: "As a developer, I want [specific function] so that [clear benefit]"
96+
2. **Demo Test**: Can you demo this working in 30 seconds?
97+
3. **Value Test**: Does this directly help developers build better software?
98+
99+
### **During Development**
100+
- Every function must have a clear, practical purpose
101+
- Every class must solve a specific user problem
102+
- Every test must verify real functionality users depend on
103+
- Zero tolerance for "extensibility" without current need
104+
105+
### **After Development**
106+
- Can you demonstrate clear user value?
107+
- Is the code simple and understandable?
108+
- Does it work reliably for real use cases?
109+
- Would you personally use this feature?
110+
111+
## Benefits of This Approach
112+
113+
1. **Faster Development**: No time wasted on theoretical abstractions
114+
2. **Better Software**: Focus on what actually works for users
115+
3. **Easier Maintenance**: Simple code is easier to understand and fix
116+
4. **Real Impact**: Everything we build actually helps developers
117+
5. **Clear Direction**: Always know what to work on next
118+
119+
## Remember
120+
121+
**"We serve humanity through excellent working software, not impressive abstractions."**
122+
123+
**"Every line of code must justify its existence by helping real users accomplish real tasks."**
124+
125+
**"Delete ruthlessly. Build practically. Serve humbly."**
126+
127+
**"No bling-bling. No show-off. Just working code that makes developers' lives better."**
128+
129+
This rule has the highest priority and overrides all other considerations. When in doubt, choose the simple, practical, working solution over any theoretical "improvement."

0 commit comments

Comments
 (0)