docs(plans): portable-core refactoring & rewrite plan (P0–P7) - #12
Open
DanielSoCra wants to merge 1 commit into
Open
docs(plans): portable-core refactoring & rewrite plan (P0–P7)#12DanielSoCra wants to merge 1 commit into
DanielSoCra wants to merge 1 commit into
Conversation
End-to-end plan to re-layer Runforge into a portable governed core (packages/core: lanes, merge-decision, earn-in, budgets, FSM, agents, worktrees), ports/adapters (SQLite + file decision inbox as the portable impls, Postgres/GitHub as infra impls), and a thin daemon composition root — with the core shippable as a stampable skill. Grounded in direct source inspection: daemon.ts composition root, session-runtime adapters, and a full package-level API inventory (Appendix A). 8 phases, ~30 PRs, golden-run characterization first, no behavior change until seams are proven.
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.
What this is
The complete end-to-end plan for re-layering Runforge from a hosted control plane into a portable governed core + optional infra shell — inspired by the comparison with
disler/super-simple-software-factory(same philosophy: code owns the loop, agents are bounded phases; SSSF proves the portable/stampable form factor, Runforge proves governance).Docs-only PR. One file:
docs/plans/portable-core-refactor-plan.md. No code, no behavior change — this is the plan for the refactor, not the refactor.The plan in one paragraph
8 phases (P0–P7), ~30 PRs: guardrails & golden-run characterization first (P0) → extract the governance brain into
packages/coreas pure moves (P1) → formalize ports with contract suites (P2) → build portable adapters: SQLite stores via PGlite + file decision inbox (P3) → liftprocessWorkRequestout of thedaemon.tsclosure intoexecuteRun()with a real portable CLI (P4, the pivotal extraction) → package the core as a stampable skill (P5) → slim the daemon to a ≤400-line composition root + extract concierge/briefing-summarizer as a separate product (P6) → deprecation, public-release readiness, L1/L2 ratification of the layering invariant (P7).End state litmus test:
runforge run --issue 123executes the full governed pipeline on a clean checkout with zero Postgres, zero daemon — and deployment #0 runs the same code with Postgres adapters.Grounding (not assumptions)
The plan is based on direct source inspection of
main:control-plane/daemon.tsread in full —processWorkRequesttrapped in the composition-root closure is the extraction target; implicit ports (ConfigReader,RunWriter,TrunkReader,PromotionPort) already exist.decision-indexalready ships port contracts with fakes (Notifier/SourceSink/ResumeDispatcher) — P2 formalizes proven seams rather than inventing them.Non-negotiables encoded in the plan
decideMerge-stays-purepattern).mainat all times; the old run spine stays behind a flag until P7.Review focus
concierge+briefing-summarizerto a separate repo (recommended) vs. keep as infra-shell opt-ins — needs an Operator decision.core,adapters-sqlite,adapters-github,adapters-postgres) before P1 starts moving files.