cyberneticlibrary

Recover C code from abandoned decompositions

reclaim-nakedworkflowsetup L30
JRickey/frog-adv-temple-decomp
What it does

Reclaim NAKED decompilation stubs back to true C via corpus idioms

Best for

Driving down NAKED rate in a decompilation project by reclaiming stubs using corpus-mined matching patterns and fresh permuter/search tooling.

Inputs
  • · DEFAULT_CANDIDATES: list of NAKED function addresses in game/engine
  • · optional: custom candidates, parallel worktrees (K), onStuck strategy (leave-naked | demote-to-asm), maxBatches
Outputs
  • · per-target: promoted (NAKED→true-C), demoted (NAKED→asm slice), stuck (unchanged), or skipped
  • · commits integrated onto main (cherry-pick + make check per batch)
  • · updated README + prune worktrees
  • · final NAKED count
Requires
  • · git worktree (K parallel batches)
  • · make build system
  • · corpus mining (cvaos, pret, prior decomps for matching idioms)
  • · bash shell
Preconditions
  • · git repo initialized at /Users/jackrickey/Dev/frog-adv-decomp
  • · Bootstrap complete: gitignored deps symlinked, make check passes
  • · Candidates are actual NAKED functions (marked NON_MATCHING in source)
  • · Corpus (cvaos/pret) accessible for idiom reference
Failure modes
  • · Candidate already promoted this session → agent skips (idempotent)
  • · Worktree bootstrap fails (missing deps) → batch blocked, status reported
  • · Parallel agents edit same file → cherry-pick conflict, failed batch reverted
  • · make check fails post-commit → integration reverted, candidate stuck
  • · Layout-blocked function (not solvable) → left as NAKED or demoted per ON_STUCK strategy
Trust signals
  • · Corpus idiom explicitly cited when promoting (cvaos ref, pret match location)
  • · make check pass post-commit (structural + binary integrity verified)
  • · SHA-1 parity verified if available
  • · Prior successful promotions logged per session (6 already done tracked in DEFAULT_CANDIDATES)