Repository navigation
Add lesson lifecycle governance based on self-evolving agent research - #1
Draft
RevenuePuzzles wants to merge 1 commit into
Draft
RevenuePuzzles wants to merge 1 commit into
RevenuePuzzles wants to merge 1 commit into
Conversation
This PR introduces lesson lifecycle management to prevent unbounded accumulation and ensure lessons are grounded in verifiable evidence. Changes: - evidence.md: Add lesson lifecycle (provisional → validated → retired), usage tracking guidance, caps (~30-50 lines per file), and retirement rules for stale or unused lessons - compound.md: Require cited incidents before writing lessons (prevents phantom rules), add consistency checks, distinguish provisional vs validated status, enforce caps before writing - audit.md: Add lifecycle health checks, size/cap monitoring, retirement candidate identification - context-contract.md: Reference lifecycle rules in write safety section Based on findings from 'Self-Evolving Coding Agents' survey (arXiv 2608.03392v4), particularly: - P5: Cap, prune and retire - unbounded accumulation degrades retrieval - P6: Gate admission before commit - defective lessons contaminate later - P8: Don't fix phantom failures - rules need cited incidents - P9: Self-graded memories inflate wrong episodes - need external validation - P11: Make changes versioned and reversible - lifecycle with statuses Co-authored-by: Revenue Puzzles <RevenuePuzzles@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces lesson lifecycle management to prevent unbounded accumulation and ensure lessons stored in the GTM home are grounded in verifiable evidence. The changes are based on findings from the "Self-Evolving Coding Agents" survey (arXiv 2608.03392v4).
Changes
evidence.md— Lesson lifecycle and governanceprovisional→validated→retiredprovisional(one cited incident, one source)validatedrequires external evidence (second source, later outcome confirming prediction)retiredstatus for lessons that no longer apply, with reason preservedcompound.md— Admission gatingprovisional; promotion needs external evidenceaudit.md— Lifecycle health monitoringcontext-contract.md— Write safety referenceResearch basis
Each change maps to specific findings from the survey:
What I considered but deliberately left out
Automated usage tracking infrastructure: The survey suggests tracking usage counts, but adding a Python script or structured tracking would change the project's "plain Markdown" philosophy. Instead, I added lightweight annotation guidance that teams can adopt optionally.
Explicit lesson IDs: The survey's lesson record format (L-2026-10-18-01) is rigorous but would add friction to the human-readable Markdown files. The date + source in each line serves as a de facto ID.
Frozen eval set for measuring improvement: The survey recommends a held-out task set to measure whether the home actually improves outcomes. This would require significant infrastructure and is more appropriate for a follow-up that adds measurement tooling.
Conflict detection automation: The survey discusses checking consistency with existing libraries programmatically. This would require code changes; instead I strengthened the manual check instructions.
Per-client scoping enforcement: The context-contract already says "never let one client's data appear in another's home" but doesn't enforce it technically. Enforcement would need code changes beyond documentation.
Further recommendations (not implemented)
Prioritized list of improvements that could follow this PR:
Measurement framework (high value, medium effort): Add guidance for tracking whether campaigns that start from a populated home actually outperform fresh starts. This maps to P12: "Measure improvement across tasks, net of cost."
Structured lesson IDs (medium value, low effort): If teams want rigorous tracking, add a YAML-frontmatter option for lesson files with explicit IDs, creation dates, and validation history.
Automated conflict detection (medium value, higher effort): A Python script in
scripts/that parses the Markdown files and flags contradictions or duplicates beforecompoundwrites.Retirement workflow (medium value, low effort): A new move (
retire) specifically for reviewing and removing lessons, as a counterpart tocompound.Cross-home aggregation safeguards (high value for multi-client users): Technical enforcement that lessons from one client cannot leak into another's home, beyond the current documentation warning.
Testing
python scripts/build.py --checkpasses