feat: openlock setup + init onboarding wizards (bd openlock-lvc.1)#56
Merged
Conversation
…nitize harness in comments
… scaffold/restore
…faults, quote mount paths, getting-started usage
- README: drop stale "auto-inits the repo" (sandbox now requires .openlock/); add setup + init to the commands table so the table matches the corrected sandbox line. - scaffoldManifest: quote env keys that aren't bare-safe identifiers so guided-mode keys with spaces/colons still emit parseable YAML (values were already JSON.stringify'd; keys were not). +test. - init --force: tell the user regenerate overwrote prior hand-edits.
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
Two onboarding commands that make the golden path
install → doctor → setup → init → validate → sandboxreal, plus a behavior change that removes implicit.openlock/scaffolding.openlock setup— machine-layer defaults → global config. Walks runtime (reusesruntime-wizard), a new harness picker, and provider (reuseslogin), persistingdefault_runtime/default_harness/default_provider. Closes the prior gaps wheredefault_harnesshad no interactive setter anddefault_providerwas read-only. Provider list is filtered to harness-compatible ids (filter lives only insetup—loginstandalone is unchanged). Re-runs preselect current values. Non-TTY prints a manual-config hint and exits 1.openlock init— project scaffold of.openlock/. Entry fork: write sensible defaults (also the non-TTY path) or guided Q&A. Emits an explicit, commentedconfig.yamlwith a real workdir mount (the fix for the empty-{}default), a harness-trimmedpolicy.yaml, and a seededContainerfile. Gap-fill: on an incomplete folder, regenerates only the missing files and leaves hand-edited ones untouched. Refuses a complete folder unless--force.--harnessoverrides the scaffold harness.config-core— purescaffoldManifest/scaffoldPolicygenerators next to the linters, guarded by a lint-clean invariant (generator output must passlintManifest/lintPolicy, validated against the real default policy). Policy trim is registry-based (keeps the chosen harness + sharednpm_packages/python_packages, drops the rest with a one-line pointer comment) so it scales to N harnesses..openlock/resolution is now complete-or-error.openlock sandboxno longer lazily scaffolds/restores; a missing or incomplete.openlock/errors with "runopenlock init". DeletesresolveFirstRun+ allresolveRestored*paths + the empty-{}write.--policy <path>bypass is unchanged.Both harness pickers derive options from
HARNESSES(no hardcoded list), andinitreadsdefault_harnessas a preselect, never enforcement.Test plan
bun run lint/bun run typecheck/bun run knip— all cleanbun run test— 678 pass, 8 skip, 0 failplanInitmodes,persistGlobalDefault,runSetupordering + preselect + non-TTY,runInitfresh/gapfill/force/complete + guidedinit(fresh → defaults) →validateok; deletepolicy.yaml→initgap-fills only it →validateok;sandboxon a folder with no.openlock/→ errors with the init hintopenlock complete bashlistsinit+setupsetupinteractively on a real machine (runtime/harness/provider persist + idempotent re-run preselect)Closes openlock-lvc.1 (rescoped to cover both commands). Unblocks openlock-lvc.4 (docs restructure).