Complete fresh setup onboarding through Hub readiness - #166
Merged
theDakshJaitly merged 2 commits intoSep 2, 2026
Merged
Conversation
…' into codex/setup-onboarding-v08
There was a problem hiding this comment.
🟡 Changes recommended
Setup’s new scaffold-copy helper should fail closed on symlinked destinations/parent directories to avoid writing scaffold templates outside the project tree.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR completes the mex setup onboarding path so a fresh or partially-populated scaffold can reach “Hub-ready” status safely: it protects checkout-local state from Git, launches a selected local agent for population, finalizes Wiki migration/indexing/validation, and prints an explicit commit checkpoint required before Hub.
Changes:
- Reworks
mex setupflow to preserve existing scaffold files, enforce ignore protection, safely persist config, run population, then finalize Graph/Wiki readiness with a commit checkpoint. - Adds new setup helpers (ignore protection, population launcher, Wiki finalization) plus targeted unit/e2e/smoke coverage.
- Updates templates/docs and managed instruction blocks to direct new sessions to read
.mex/AGENTS.md+.mex/ROUTER.mdand to recommendmex sync.
File summaries
| File | Description |
|---|---|
| test/wiki-architecture.test.ts | Extends scaffold-write allowlist for new setup modules. |
| test/sync.test.ts | Covers unbounded interactive launch option for Codex path. |
| test/setup-grounding-e2e.test.ts | Exercises Wiki finalization as part of setup grounding flow. |
| test/config.test.ts | Adds atomic publish + symlink safety expectations for config writes. |
| templates/SYNC.md | Updates guidance to recommend mex sync instead of .mex/sync.sh. |
| templates/SETUP.md | Updates setup doc to reflect new end-to-end onboarding workflow. |
| templates/.tool-configs/CLAUDE.md | Adds session bootstrap instruction to managed MEX block. |
| src/sync/index.ts | Adds configurable timeout behavior to runToolInteractive. |
| src/setup/wiki-finalize.ts | New setup-facing Wiki migration/index/validation wrapper. |
| src/setup/population.ts | New safe launcher for Claude/Codex population via ignored prompt file. |
| src/setup/index.ts | Main setup flow rewrite: preservation, ignore verification, finalization, commit checkpoint. |
| src/setup/ignore.ts | New .mex/.gitignore setup-managed rule installer + Git verification. |
| src/setup/tests/wiki-finalize.test.ts | Unit tests for Wiki finalization stages and safety properties. |
| src/setup/tests/state.test.ts | Tests scaffold preservation, readiness checks, and config validation. |
| src/setup/tests/population.test.ts | Tests prompt-file transport, cleanup, and fail-closed behavior. |
| src/setup/tests/ignore.test.ts | Tests ignore rule creation/append semantics and Git verification. |
| src/config.ts | Makes config patch writes atomic via stage + rename. |
| src/agent-skills/instructions.ts | Adds “read AGENTS/ROUTER first” line to managed block rendering. |
| src/agent-skills/tests/instructions.test.ts | Asserts managed instruction block contains new bootstrap line. |
| scripts/hub-pack-smoke.mjs | Adds packed fresh-setup smoke and verifies ignore/config readiness. |
| README.md | Updates setup description and adds explicit commit + Hub readiness notes. |
| CLAUDE.md | Updates managed MEX block with session bootstrap instruction. |
| CHANGELOG.md | Documents updated setup behavior and safety fixes. |
| AGENTS.md | Updates managed MEX block with session bootstrap instruction. |
| .mex/SYNC.md | Mirrors template sync doc update in scaffold copy. |
| .mex/SETUP.md | Mirrors template setup doc update in scaffold copy. |
| .mex/ROUTER.md | Updates project-state notes and last_updated date. |
| .mex/.tool-configs/CLAUDE.md | Mirrors template Claude tool-config managed block update. |
Review details
- Files reviewed: 28/28 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+69
to
+76
| export function ensureScaffoldFile(src: string, dest: string, dryRun = false): ScaffoldFileAction { | ||
| if (existsSync(dest)) return "skip"; | ||
| if (!dryRun) { | ||
| mkdirSync(dirname(dest), { recursive: true }); | ||
| copyFileSync(src, dest); | ||
| } | ||
| return "copy"; | ||
| } |
theDakshJaitly
merged commit Sep 2, 2026
49c6bdc
into
integration/human-team-memory-v1
10 checks passed
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
mex hub.mex/AGENTS.mdand.mex/ROUTER.mdValidation
npm run typechecknpm run test:hub:packagegit diff --checkIntegration
This branch includes the latest
integration/human-team-memory-v1head (28cdc79, PR #165) through merge commit0395b7c.