merge: milestone/v0.4-distribution → main (v0.4 Distribution & Bootstrap CLI complete)

The nextcraft bootstrap CLI ships: doctor/bootstrap/verify/dev commands, a
one-liner install script with checksum + version integrity gates, and linux
x64 SEA binaries published on every release going forward (v0.3.2 onward).
Fresh-clone E2E proven; 34 CLI tests + full monorepo gates green.

Escalation note: merge_to_main hook — proceeding per full autonomy + founder
directive D-016 (streamlined install + bootstrap CLI + ongoing binaries,
recorded at P0 SPECIFY).

---ci---
phase: 4
milestone: v0.4
status: complete
requirements:
  covered: [REQ-4-001, REQ-4-002, REQ-4-003, REQ-4-004, REQ-4-005]
  partial: []
---/ci---
This commit is contained in:
CIAgent
2026-09-12 23:17:43 +00:00
parent fb2db4ee97
commit 2c68b44c1a
40 changed files with 2093 additions and 691 deletions
+55 -108
View File
@@ -2,17 +2,17 @@
## Overview
**Milestone v0.3COMPLETE (shipped as v0.2.8, 2026-09-12).** Next milestone: v0.4 (real server STT/TTS + KYC/identity + design/simulation sandbox environments + exec-telemetry seq-lease — the deferred seams named in the v0.2.8 release note).
**Milestone v0.4Distribution & Bootstrap CLI (founder directive, 2026-09-12).** Streamline installing Nextcraft: a `nextcraft` bootstrap CLI shipped as a linux x64 binary, installed via a one-liner script, with binaries published on every ongoing release. Next milestone: v0.5 (real server STT/TTS + KYC/identity + design/simulation sandbox environments + exec-telemetry seq-lease — the seams deferred out of v0.4 by the founder directive).
**Milestone v0.3** — Credential Engines: Replace v0.2's mock engine inputs with real credential engines. Build the sandbox fabric (sandboxed IDE / design tool / simulation), the live in-environment build-telemetry pipeline, the process-trace grading engine, per-learner variant task generation, and the oral/voice defense with AI examiner. Lab/Assessor/Proctor agents move from mock inputs to real engine inputs.
**Milestone v0.3** — Credential Engines: complete, shipped as v0.2.8 (2026-09-12). Real sandbox fabric, live build telemetry, process-trace grading, per-learner variants, oral defense, real learner surfaces.
**Deferred per founder directive:** REQ-F-017 identity verification + age-gating (real KYC backend) is deferred beyond v0.3. Age-gating remains the v0.1 visual flow mockup.
**Deferred per founder directive (D-016):** REQ-F-017 identity verification + age-gating (real KYC backend), real server STT/TTS, design/simulation sandbox environments, and the exec-telemetry seq-lease are deferred to v0.5. Age-gating remains the v0.1 visual flow mockup.
**Prior milestone:** v0.2 (ai-tutor-architecture) — complete, shipped as v0.2.0, six tutor agents live over mock engine inputs (D-015).
**Milestone type:** Feature (new credential-engine services + real agent inputs)
**Tag line:** v0.2.x (patches on the v0.2 line; milestone release as the final v0.2.x patch)
**Branch:** milestone/v0.3-credential-engines
**Milestone type:** Feature (new CLI + distribution pipeline)
**Tag line:** v0.3.x (patches on the v0.3 line; milestone release as the final v0.3.x patch)
**Branch:** milestone/v0.4-distribution
---
@@ -20,14 +20,11 @@
| # | Name | Status | Depends On | Requirements | Success Criteria |
|---|------|--------|------------|--------------|------------------|
| 0 | Pre-execution | complete | — | — | Specification, clarify, research, plan complete; .ciagent/ files updated for v0.3 |
| 1 | Sandbox fabric | complete | 0 | REQ-3-001, REQ-3-002 | Isolated per-learner sandbox environments provisioned (IDE / design / simulation); lifecycle API (create/destroy/snapshot); resource limits enforced; no cross-tenant access |
| 2 | Live build telemetry | complete | 1 | REQ-3-003 | In-environment capture of process events (commands, file diffs, run/test results, keystroke-level activity) streamed to ai-service; reliable transport; per-learner trace persistence |
| 3 | Process-trace grading engine | complete | 2 | REQ-3-004 | Grades artifacts from their full process traces (not just final output); emits structured rubric-aligned scores; feeds Assessor real inputs |
| 4 | Variant task generation | complete | 1 | REQ-3-005 | Per-learner task variants generated so no two learners receive identical prompts; variant seed recorded for grading fairness |
| 5 | Oral / voice defense | complete | 3 | REQ-3-006 | AI examiner conducts spoken defense of submitted work; STT → dialogue → TTS; transcript + integrity signals captured; feeds Proctor/Mentor |
| 6 | Agent re-grounding + learner surface integration | complete | 2,3,4,5 | REQ-3-007, REQ-3-008 | Lab/Assessor/Proctor consume real engine inputs; v0.1 sandbox + assessment mockups wired to real engines (in-browser build/run, live telemetry, live defense) |
| 7 | Final review + ship | complete | 6 | — | Code review clean; audit passes; milestone tagged (v0.2.x final patch); release created on Gitea |
| 0 | Pre-execution | complete | — | — | Specification, clarify, research, plan complete; .ciagent/ files updated for v0.4 |
| 1 | Bootstrap CLI core | complete | 0 | REQ-4-001, REQ-4-002 | `nextcraft doctor/bootstrap/verify/dev` work against a fresh clone; unit tests green |
| 2 | Binary build + release pipeline | complete | 1 | REQ-4-003, REQ-4-004 | Reproducible linux x64 binary + sha256 checksum; one-liner install script; assets uploaded to the Gitea release |
| 3 | Install docs + fresh-clone E2E | complete | 2 | REQ-4-005 | README quickstart verified end-to-end from a clean environment; fresh clone reaches running stack |
| 4 | Final review + ship | in-progress | 3 | — | Code review clean; audit passes; milestone tagged (v0.3.x final patch); release with binary assets created on Gitea |
---
@@ -35,148 +32,98 @@
### Phase 0: Pre-execution
**Goal:** Establish v0.3 specification, clarify ambiguities, research credential-engine architecture (sandbox isolation, telemetry transport, trace grading, variant generation, voice IO), create detailed plans.
**Goal:** Establish v0.4 specification (founder directive D-016), clarify ambiguities, research the binary toolchain + Gitea release-asset API + existing bootstrap scripts, create detailed plans, grill adversarially.
**Stages:** SPECIFY → CLARIFY → RESEARCH → PLAN → GRILL → MVP/UX CHECK → SHIP
**Deliverables:**
- Updated .ciagent/config.json, PROJECT.md, REQUIREMENTS.md, ROADMAP.md, ARCHITECTURE.md, PERSONAS.md, PLAN.md
**Success criteria:** All .ciagent/ files updated for v0.3; phase 0 shipped as first v0.2.x patch.
**Success criteria:** All .ciagent/ files updated for v0.4; phase 0 shipped as v0.3.0.
---
### Phase 1: Sandbox Fabric
### Phase 1: Bootstrap CLI Core
**Goal:** Provision and manage isolated per-learner execution environments.
**Goal:** A working `nextcraft` CLI with doctor/bootstrap/verify/dev commands, unit-tested against the real monorepo.
**Requirements:** REQ-3-001, REQ-3-002
**Requirements:** REQ-4-001, REQ-4-002
**Key deliverables:**
- Sandbox orchestrator service: create/list/destroy/snapshot sandbox instances (coding IDE — design tool and simulation environments deferred to v0.4 per D-025)
- Isolation boundary: per-learner Linux user/mount/pid/net namespace subprocess isolation (`unshare`, D-024); no cross-tenant filesystem/network access
- Resource limits: CPU/memory/single-file-size quotas (rlimits) + wall-clock timeout reaper + best-effort workdir-size sweep; per-sandbox pids + hard disk quota accepted as v0.3 gaps (G-1/G-2)
- Sandbox lifecycle API consumed by ai-service and the web learner surface
- `apps/cli` package: `nextcraft` executable (source-runnable in dev, binary-built in P2)
- `doctor`: checks node ≥18, pnpm, python3 ≥3.11, git, unshare availability — actionable errors, exit codes
- `bootstrap`: idempotent — pnpm install, ai-service venv + pinned deps (reuses scripts/bootstrap.sh logic), .env from .env.example templates, key validation (warnings not blockers for optional keys), .env.secrets handling
- `verify`: health check — venv imports, pnpm build readiness, ports free, env vars present
- `dev`: thin passthrough to scripts/dev.sh (no orchestration logic duplicated)
- Unit tests: doctor/bootstrap parsing + command dispatch, against fixtures (never modifying the real repo state)
**Success criteria:**
- A sandbox can be created, written to, snapshotted, and destroyed via API
- Isolation verified: a sandbox cannot read another learner's data
- Resource limits enforced and observable — enforcement mechanism: rlimits (memory/CPU) + wall-clock reaper + workdir-size sweep; per-sandbox pids and hard-disk-quota are accepted v0.3 gaps (no cgroup delegation/sudo on this box, G-1)
- `nextcraft doctor` reports each prerequisite with actionable guidance
- `nextcraft bootstrap` on a fresh clone reaches a state where `verify` passes
- All commands have `--help`, exit non-zero on failure, no shell-out without timeout
- `pnpm build`, `pnpm typecheck`, `pnpm ai:test` green
---
### Phase 2: Live Build Telemetry
### Phase 2: Binary Build + Release Pipeline
**Goal:** Capture in-environment process events and stream them to ai-service reliably.
**Goal:** Reproducible linux x64 binary + one-liner install + release-asset upload wired into the ship flow.
**Requirements:** REQ-3-003
**Requirements:** REQ-4-003, REQ-4-004
**Key deliverables:**
- Telemetry capture agent (in-sandbox): commands, file diffs, run/test results, keystroke-level/activity events
- Telemetry transport: durable, ordered, resumable stream to ai-service ingestion endpoint
- Trace persistence: per-learner, per-task process traces stored for grading and proctoring
- Transport hardening: retries, backpressure, exactly-once-or-at-least-once semantics documented
- Build script producing `nextcraft-linux-x64` + `nextcraft-linux-x64.sha256` (toolchain probe-verified at RESEARCH; embedded script assets)
- One-liner install script `install.sh` served from the repo: detect linux x64, resolve latest release via Gitea API, download + verify checksum, install to `~/.local/bin`, PATH hint, source-bootstrap fallback when no binary/asset
- Ship integration: every release from v0.4 onward attaches the binary + checksum as release assets (the "ongoing binaries" requirement)
- Asset-upload helper using the Gitea token from `.env*` files only (never shell env)
**Success criteria:**
- Sandbox activity produces a complete ordered process trace in ai-service
- Stream survives transient network failure without trace loss
- Trace retrievable by learner+task ID for grading
- Binary runs on this box: `./nextcraft-linux-x64 doctor` green against the repo
- Install script verified end-to-end against the real Gitea release (or local dry-run if release pending)
- Checksum verification rejects a corrupted download (tested)
- Release assets present on the phase ship
---
### Phase 3: Process-Trace Grading Engine
### Phase 3: Install Docs + Fresh-Clone E2E
**Goal:** Grade learner artifacts from their full process traces.
**Goal:** Documentation and end-to-end proof that a fresh consumer reaches a running stack via the one-liner.
**Requirements:** REQ-3-004
**Requirements:** REQ-4-005
**Key deliverables:**
- Trace analyzer: reconstructs build/decision timeline from a process trace
- Grading engine: rubric-aligned scoring over the trace (process quality, not just final artifact)
- Structured score output consumable by the Assessor agent
- Calibration against v0.2 mock corpora to validate grading dimensions
- README quickstart: one-liner → `nextcraft doctor``nextcraft bootstrap``nextcraft dev`
- CLI command reference (all flags, exit codes)
- Fresh-clone E2E test: clean temp clone → doctor → bootstrap → verify → build green (sandboxed; no network beyond package registries already used)
- Install-script docs: prerequisites, offline/manual install, troubleshooting
**Success criteria:**
- Engine emits structured rubric-aligned scores from a real process trace
- Scores distinguish process quality (e.g., iterative debugging vs. paste-and-run)
- Output feeds Assessor; replaces pre-baked artifact corpus inputs
- A fresh clone bootstraps to a passing `verify` with one command sequence
- README quickstart matches the actual tested flow exactly
- E2E test green in CI-equivalent local run
---
### Phase 4: Variant Task Generation
### Phase 4: Final Review + Ship
**Goal:** Generate per-learner task variants so no two learners receive identical prompts.
**Requirements:** REQ-3-005
**Key deliverables:**
- Variant generator: parameterized task templates → unique per-learner instances
- Variant seed registry: record variant parameters for grading fairness and proctoring
- Difficulty normalization: variants calibrated to equivalent difficulty
**Success criteria:**
- Two learners requesting the same competency receive distinct task variants
- Variant parameters persisted and auditable
- Grading engine scores variants equitably
---
### Phase 5: Oral / Voice Defense
**Goal:** AI examiner conducts a spoken defense of the learner's submitted work.
**Requirements:** REQ-3-006
**Key deliverables:**
- Voice pipeline: STT → defense dialogue (LLM examiner) → TTS
- Examiner agent: probes understanding, challenges process choices from the trace
- Transcript + integrity signals captured for Proctor/Mentor
- Latency budget: defense feels conversational (bounded turn latency)
**Success criteria:**
- A spoken defense runs end-to-end (speak → examiner question → learner response → verdict)
- Transcript + integrity signals persisted and consumable by Proctor
- Turn latency within the documented budget
---
### Phase 6: Agent Re-grounding + Learner Surface Integration
**Goal:** Move Lab/Assessor/Proctor to real engine inputs; wire learner surface to the real engines.
**Requirements:** REQ-3-007, REQ-3-008
**Key deliverables:**
- Lab agent consumes live sandbox telemetry (replaces v0.2 mock telemetry)
- Assessor agent consumes grading-engine output (replaces pre-baked artifacts)
- Proctor consumes telemetry + defense integrity signals (replaces mock telemetry)
- Learner sandbox mockup → real in-browser build/run; assessment mockup → live defense + live grading
**Success criteria:**
- Lab/Assessor/Proctor operate on real inputs with no mock fallback in the learner path
- Learner can build in-browser and see live telemetry + live feedback
- Assessment surface runs a live defense and shows live grading
- `pnpm build` and `pnpm typecheck` pass
---
### Phase 7: Final Review + Ship
**Goal:** Code review, audit, milestone release.
**Goal:** Code review, audit, milestone release with binary assets.
**Key deliverables:**
- Multi-persona code review (correctness, testing, security, performance, maintainability)
- Project health audit (reconstruction test, .ciagent/ file discipline, branch hygiene, commit discipline)
- Milestone ship: merge milestone → main, tag final v0.2.x patch, create Gitea release
- Milestone ship: merge milestone → main, tag final v0.3.x patch, create Gitea release WITH binary + checksum assets, verify assets downloadable
**Success criteria:**
- Code review: P0 fixes applied, P1+ documented
- Audit: all checks pass, project state reconstructable from git log
- Ship: milestone tagged, branch merged to main, Gitea release created — release note states identity/age-gating (KYC) is deferred and age-gating remains a visual mockup
- All v0.3 requirements marked complete
- Ship: milestone tagged, branch merged to main, Gitea release created with `nextcraft-linux-x64` + `.sha256` assets attached — the first of the ongoing binary releases
---
## v0.4 (In Progress — Distribution & Bootstrap CLI)
Distribution & Bootstrap CLI: `nextcraft` CLI (doctor/bootstrap/verify/dev), one-liner install, linux x64 release binaries on every ongoing release, install/quickstart docs. 5 phases (P0P4). Requirements REQ-4-001..005.
## v0.3 (Complete — Shipped as v0.2.8)
Credential Engines: real sandbox fabric (Linux namespaces), live build telemetry