Skip to content

feat(cli): xnet code — agentic dev-loop command (0194, Phase 4) - #155

Merged
crs48 merged 2 commits into
mainfrom
feat/xnet-code-devloop-0194
Jun 17, 2026
Merged

feat(cli): xnet code — agentic dev-loop command (0194, Phase 4)#155
crs48 merged 2 commits into
mainfrom
feat/xnet-code-devloop-0194

Conversation

@crs48

@crs48 crs48 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What & why

Exploration 0194, Phase 4 (code/plugins). The bridge lets an agent edit your workspace (PRs #148, #152). This adds the other axis the prompt asked for — authoring/editing code & plugins — by exposing the proven @xnetjs/devkit dev-loop as a command.

xnet code "<intent>" isolates in a git worktree → runs your own coding agent (Claude Code/Codex/aider) → runs the validation gate (typecheck → lint → test → fallow) → checkpoints on pass / rolls back on fail → optionally opens a PR.

Changes

  • @xnetjs/cli — new code command. Thin wiring over devkit (runAgentTask + defaultXnetGate + cliAgentRunner + Git + openPullRequest), with pure, tested helpers:
    • resolveCodeRunConfig(prompt, options, repoRoot, now?) — maps CLI options → dev-loop config (id/branch/base/worktree/gate/keepWorktree); clock injected for deterministic ids.
    • summarizeAgentTaskResult(result) — result → one-liner (passed / no-changes / gate-failed-at-X / failed).
    • Flags: --agent, --id, --branch, --base, --worktree, --pr, --keep, --repo.

Tests / validation

  • CLI 43 (code 7: config derivation, explicit overrides, keep-on-PR, all four summary states). The heavy worktree→gate→checkpoint loop is already covered by devkit's real-temp-git e2e.
  • typecheck, eslint --max-warnings 0, prettier --check: clean. No new deps (cli already depends on @xnetjs/devkit).
  • Not in CI: end-to-end with a live coding agent.

Deferred

Wiring "create/edit a plugin" into the in-app UI (e.g. the bridge daemon's /run endpoint over devkit handleBridgeRun) + combining with the plugin scaffolder; and the ACP transport / in-panel approvals from earlier phases.

🤖 Generated with Claude Code

xNet Test and others added 2 commits June 17, 2026 13:35
Exposes the proven devkit dev-loop as a command so you can vibe-code xNet (or a
scaffolded plugin) with your own coding agent: isolate in a git worktree → the
agent edits → validation gate (typecheck → lint → test → fallow) → checkpoint on
pass / roll back on fail → optionally open a PR.

`xnet code "<intent>" [--agent claude|codex|aider] [--base <ref>] [--pr]
[--keep] [--worktree <dir>] [--branch <name>] [--id <id>] [--repo <dir>]`

Thin wiring over @xnetjs/devkit (runAgentTask + defaultXnetGate + cliAgentRunner
+ Git + openPullRequest). Pure, tested helpers: resolveCodeRunConfig (options →
dev-loop config) and summarizeAgentTaskResult (result → one-liner). The heavy
loop is already covered by devkit's real-temp-git e2e.

Tests: cli 43 (code 7). typecheck, eslint --max-warnings 0, prettier clean.

This checks off the 0194 Phase 4 "code/plugins" item at the CLI level; wiring it
into the in-app UI (e.g. the bridge daemon's /run endpoint, devkit handleBridgeRun)
remains deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@crs48
crs48 temporarily deployed to pr-155 June 17, 2026 20:36 — with GitHub Actions Inactive
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Preview removed for PR #155.

@crs48
crs48 merged commit aa71332 into main Jun 17, 2026
8 of 9 checks passed
@crs48
crs48 deleted the feat/xnet-code-devloop-0194 branch June 17, 2026 20:42
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
.option('--pr', 'Open a pull request when the gate passes')
.option('--keep', 'Keep the worktree after a successful run')
.option('--repo <dir>', 'Repo root (default current dir)')
.action(async (intent: string, options: CodeRunOptions) => {
crs48 added a commit that referenced this pull request Jun 18, 2026
…193/0194) (#201)

The `changelog-section` required check was only added in #164, so the
0192/0193/0194 feature batch merged before it never got changelog
entries. This backfills the 12 user-facing features that were missing,
each dated to its merge day with its PR number and contributors:

| PR | Entry |
|----|-------|
| #138 | A safer foundation for plugins |
| #145 | One trust model across plugins and Labs |
| #146 | Reliability you can see for managed hubs |
| #148 | Drive your own coding agent from xNet |
| #149 | AI that can act on your workspace |
| #150 | Your Labs become AI tools |
| #152 | Your agent can use your workspace |
| #154 | AI edits, right inside the editor |
| #155 | An agentic dev loop in your terminal |
| #158 | Review AI edits before they apply |
| #159 | Kick off agentic code tasks from xNet |
| #162 | Plugins run on the Labs runtime |

Skipped: PRs already covered by umbrella entries (#142 plugin ecosystem,
#144 extensibility fabric, #147 automated changelog, #163 agent panel,
#180 changelog gallery), internal-only changes (#139 schema authz — zero
user-facing effect), and meta/test/docs PRs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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