dankofly/perfectify / skill/dagx-agi-kernel
dagx-agi-kernel
VerifiedImprove and verify agent work after repeated failures, in dependency-heavy tasks, or when optimization claims need baseline and regression evidence. Use for DAGx/Perfectify requests, failed retries, risky multi-step work, or requests to verify an improvement. Exclude routine questions, drafting, one-step edits, and directly checkable calls.
references/memory-rsi.md
View on GitHub# Memory and Bounded Recursive Self-Improvement
Load this reference when a lesson may persist, repeated failure suggests a reusable change, the kernel modifies itself, or transferable capability gain is claimed.
## 1. Memory Contract
Memory stores scoped, verified, reusable knowledge. It is not transcript storage, a confidence amplifier, or evidence merely because the system wrote it.
Candidate schema:
`id | trigger | scope | lesson | evidence | procedure/rule | detector/test | provenance | freshness | uncertainty | retirement condition`
States:
- `Q`: quarantined candidate; not trusted for action.
- `P`: provisionally useful in the observed scope.
- `T`: trusted only within evaluated scope.
- `R`: retired, superseded, stale, or refuted.
Promotion:
- `Q -> P`: direct evidence from the originating case and no contradiction.
- `P -> T`: recurrence, independent confirmation, or transfer evaluation appropriate to the claim.
- `P/T -> R`: contradictory stronger evidence, expired freshness, changed environment, narrower successor, or failed detector/regression test.
Memory rules:
1. Preserve scope, provenance, version/date, freshness, uncertainty, and falsifier.
2. Store stable decisions, validated procedures, recurring constraints, and reliable failure detectors.
3. Do not store speculation as fact, raw transcripts, redundant summaries, secrets, or unnecessary sensitive data.
4. User feedback is evidence of preference/intent; it is not automatic proof of external facts.
5. Retrieve only entries that can change the current decision.
6. Merge duplicates and prefer the narrowest accurate rule.
7. Revalidate time-sensitive memory before consequential use.
8. If durable memory is unavailable, never claim persistence.
## 2. RSI Trigger
Start `F3` only on one or more observable signals:
`repeated_failure | protected_regression | explicit_optimization | capability_gap | reusable_learning | defective_eval | reducible_uncertainty | material_process_waste`
Do not start because recursive improvement is theoretically possible, because AGI/singularity is mentioned, or because a result could be polished indefinitely.
## 3. Improvement Object
Allowed targets:
`decomposition | retrieval | tool routing | context packing | prompts | code | verification | evals | recovery | memory | delegation | reusable procedures`
Forbidden targets:
`oversight removal | privilege expansion | unauthorized persistence | self-preservation | policy evasion | autonomous replication | concealment | evaluator/user manipulation | hidden side effects`
## 4. Controlled Cycle
1. **Gap:** identify an externally observable failure or waste.
2. **Contract:** define target metric, hard gates, baseline, scope, budget, and stop condition.
3. **Cause:** form the smallest hypothesis explaining the evidence.
4. **Change:** make the smallest reversible modification capable of testing the hypothesis.
5. **Target eval:** rerun the originating failure.
6. **Protected eval:** test mandatory behavior that the change could damage.
7. **Boundary/adversarial eval:** test likely specification gaming or distribution edges.
8. **Transfer eval:** use a meaningfully different case before claiming generalization.
9. **Decision:** promote, reject, investigate, or refine only on new evidence.
10. **Memory:** retain the scoped lesson, provenance, and retirement condition.
Do not recurse without a new evidence signal. A new rewrite or critique is not itself new evidence.
## 5. Capability Delta
Represent general capability as a vector, not an ungrounded scalar:
`g = {reasoning, planning, learning, retrieval, tool_use, calibration, robustness, transfer, efficiency, oversight_compatibility}`
For each claimed `Δg` record:
`axis | baseline | challenger | eval cases | metric/verifier | result | coverage | regression | uncertainty`
Rules:
- Claim improvement only on evaluated axes.
- Claim transfer only on held-out or meaningfully different cases.
- Claim efficiency only while holding mandatory quality/risk gates constant.
- Claim rate acceleration only from comparable repeated improvement cycles.
- Never infer AGI, recursive takeoff, or technological singularity from one prompt, task, benchmark, or successful self-edit.
## 6. Self-Modification Protocol
When this kernel changes itself:
1. Preserve the champion unchanged and record its static baseline.
2. Name concrete defects; do not rewrite for novelty.
3. Declare protected invariants before editing.
4. Create a challenger in an isolated path.
5. Validate frontmatter, links, scripts, progressive disclosure, and package structure.
6. Run the behavioral suite in `verification-evals.md` when a suitable harness is available.
7. Compare activation, outcome, critical errors, regressions, verifier coverage, and resource use.
8. Promote only supported improvements; otherwise keep the champion.
9. Bump version only when a challenger is promoted.
10. State explicitly when only static, not behavioral, evidence exists.
## 7. Stop Conditions
Stop recursive work when:
- target gap is closed within acceptance coverage;
- the next change is cosmetic or untestable;
- marginal evidence gain is below cost/risk;
- no independent or trustworthy verifier exists for a material claim;
- required authority, data, or human judgment is missing;
- protected regression appears and cannot be corrected without scope expansion;
- improvement work displaces the user's current objective.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |