-
predicate-logging.skill (Latest, most complete)
- All 9 formal principles
- Operational loop (fail-upward development)
- Runtime validation library
- Migration guide
- Complete synthesis
-
semantic-logging.skill (Practical patterns)
- The "catastrophic 200" problem
- State-conditional logging
- Language-specific implementations
- Good starting point for basic concepts
predicate-logging.skill/
├── SKILL.md (Main specification)
│ ├── The 9 Core Principles
│ ├── Implementation Patterns (TS/JS/Python)
│ ├── Real-world Examples
│ └── The Operational Loop (overview)
│
└── references/
├── operational-loop.md ⭐ MOST IMPORTANT
│ ├── Fail-upward development methodology
│ ├── How to deliberately test and fail
│ ├── Real iteration examples
│ └── Production monitoring loop
│
├── runtime-validation.md
│ ├── Enforcement library (TypeScript + Python)
│ ├── Automatic hierarchy validation
│ ├── Proof tree visualization
│ └── Integration with monitoring
│
└── migration-guide.md
├── 7-phase incremental adoption
├── How to retrofit existing code
├── Common pitfalls
└── Success metrics
This is what makes predicate logging a development methodology, not just better logging.
Development Phase:
1. Define predicates first ← Your assumptions about what should be true
2. Implement with logging ← Log each predicate as you check it
3. Test by deliberately breaking things ← Break each predicate on purpose
4. Read the proof tree ← See exactly which predicate failed
5. Fix the specific predicate ← Not the whole system
6. Repeat until all predicates pass ← Each failure teaches you something
Production Phase:
7. Monitor predicate pass rates ← Which ones are dropping?
8. Investigate failures ← What's the new failure mode?
9. Add predicates ← Fill gaps you discovered
10. Fix and repeat ← Continuous improvement
Traditional: Hope your code works, debug blindly when it doesn't
Predicate: Declare what should be true, test each assumption, know exactly what failed
You're not trying to write perfect code first try. You're building a system that tells you exactly what's wrong when reality diverges from your assumptions.
- Claim Rule - A log is a single predicate
- Honesty Rule - Only log what you actually checked
- Atomic First - Composite truths are inferred
- Hierarchy Rule - Children only in valid parent worlds
- Scope Rule - Be explicit about your world
- Correlation Rule - Claims belong to a specific run
- Modular Worlds - Valid subtrees are real logic
- Required Shape First - Stable schemas as contracts
- Shakespeare Monkeys - Small steps, smart environment
Upload predicate-logging.skill to Claude
"Add predicate logging to this authentication function"
Claude will:
- Map the predicate tree
- Add typed log claims
- Structure parent/child relationships
- Include correlation IDs
- Use the validation library
Read references/operational-loop.md and:
- Define predicates before implementing
- Test each predicate's failure mode deliberately
- Read the proof tree to see what failed
- Fix the specific predicate
- Repeat
- Traditional-vs-Predicate-Comparison.md - Visual side-by-side comparison
- README-predicate-logging.md - Overview and philosophy
- SKILL.md - Complete specification with all 9 principles
- operational-loop.md - HOW to actually use this in development
- runtime-validation.md - Enforcement library implementation
- migration-guide.md - How to retrofit existing codebases
- This file (you are here)
log.info("API call completed"); // 200 OK
// (data.user is null, app crashes)Problem: Technical success ≠ Semantic success
logSemantic({
predicate: "user_data_present",
passed: !!data.user,
correlationId
});
// If it fails, you know EXACTLY whySolution: Each log is a falsifiable claim about state
Traditional:
- 3 hours to find root cause
- "Can't reproduce"
- "Works on my machine"
- Blind debugging
Predicate:
- 30 seconds to find root cause
- Exact predicate that failed
- Proof tree shows the path
- Structured debugging
Metrics: 99.9% success rate
Users: "Nothing works!"
You: "But the metrics say it's working... 🤷"
Debug time: 3-4 hours per issue
Metrics:
http_request_successful: 99.9% ✅
response_parseable: 99.8% ✅
user_data_present: 95.2% ⚠️ ← The problem!
Alert: "user_data_present dropped below threshold"
Investigation: Logs show { error: "User deleted" }
Root cause: Not handling deleted users
Fix: Add user_not_deleted predicate
Debug time: 10 minutes
Use predicate logging when:
- Building systems with external dependencies (APIs, databases)
- Multi-step workflows where failure can happen anywhere
- Need to distinguish technical vs semantic success
- Want formal guarantees about runtime behavior
- Teams developing independently need coordination
- Production debugging is currently painful
Week 1: Pick one critical flow, map predicates
Week 2: Implement root predicates, test deliberately
Week 3: Complete predicate tree, add validation
Week 4: Build monitoring dashboard
Week 5-6: Prove value in production
Week 7+: Expand to next critical flow
Effort: 1-2 engineers, 4-6 weeks for first complete flow
Logs aren't debug noise. They're how you build the app.
When you declare predicates first, you're forced to articulate:
- What should be true
- How to detect when it's not
- What the failure modes are
This is design by contract + test-driven development + formal verification rolled into one.
Each log is a monkey with a constrained typewriter.
The environment is smart and scoped.
Shakespeare emerges from composition of tiny, honest, checkable claims.
- Read the comparison -
Traditional-vs-Predicate-Comparison.md - Understand the loop -
references/operational-loop.md - Upload the skill -
predicate-logging.skill - Pick one flow - Start small
- Define predicates - What should be true?
- Test deliberately - Break each predicate
- Fix and learn - Each failure teaches you something
Remember: You're not trying to avoid failures. You're trying to make failures informative.
That's fail-upward development.
This system synthesizes:
- Formal logic (predicates, hierarchies, worlds)
- Practical engineering (catastrophic 200 problem, real patterns)
- Runtime validation (self-enforcing rules)
- Development methodology (operational loop, fail-upward)
It's the bridge between elegant theory and "teams can actually use this."
"Each monkey is dumb. The environment is smart and scoped. Reliability emerges from tiny, honest, checkable claims."