Skip to content

Complete fresh setup onboarding through Hub readiness - #166

Merged
theDakshJaitly merged 2 commits into
integration/human-team-memory-v1from
codex/setup-onboarding-v08
Sep 2, 2026
Merged

Complete fresh setup onboarding through Hub readiness#166
theDakshJaitly merged 2 commits into
integration/human-team-memory-v1from
codex/setup-onboarding-v08

Conversation

@theDakshJaitly

Copy link
Copy Markdown
Collaborator

Summary

  • preserve existing scaffold content while installing verified local-data ignore protection and atomically persisting setup config
  • launch the first selected available Claude Code or Codex client from the repository root, with a Windows-safe ignored prompt-file transport and resumable manual fallback
  • capture verified Graph grounding, migrate and index the Wiki with configured scope, and block false readiness
  • print the exact canonical Git commit checkpoint required before mex hub
  • bootstrap future Claude Code and Codex sessions into .mex/AGENTS.md and .mex/ROUTER.md
  • add a true packed fresh-consumer setup smoke without expanding the CI matrix

Validation

Integration

This branch includes the latest integration/human-team-memory-v1 head (28cdc79, PR #165) through merge commit 0395b7c.

Copilot AI lite review requested due to automatic review settings September 2, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 setup flow 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.md and to recommend mex 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 thread src/setup/index.ts
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
theDakshJaitly merged commit 49c6bdc into integration/human-team-memory-v1 Sep 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants