feat: formal Yideng SFT draft orchestration - #4
Open
Tiancheng-Xu wants to merge 58 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the monorepo with (1) “formal” Yideng SFT draft/dataset orchestration for the RAG homework node, (2) a Cloudflare Pages PR-preview workflow plus a local static validator, and (3) shared UI + local GitHub profile homework backend implementations (TS/Hono + Go), along with workspace/tooling updates to support the new structure.
Changes:
- Add a stable Cloudflare Pages preview workflow for same-repo PRs, plus a Node-based workflow validator and specs/docs.
- Introduce
homeworks/04-rag-agent-orchestration/with dataset contract/quality/coverage/release logic, safety/leakage checks, and training runbook/scripts. - Restructure/extend the workspace (new
packages/ui,packages/env,packages/config) and add local GitHub profile APIs (TypeScript and Go) + related web routes/tests.
Reviewed changes
Copilot reviewed 173 out of 241 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| specs/cloudflare-pr-preview/tasks.md | Task checklist for Cloudflare PR preview rollout. |
| specs/cloudflare-pr-preview/requirements.md | Requirements + acceptance criteria for preview workflow. |
| specs/cloudflare-pr-preview/design.md | High-level design pointer and decisions summary. |
| scripts/tests/validate-cloudflare-preview.test.mjs | Tests for workflow static validator behavior. |
| scripts/tests/rag-agent-homework-layout.test.mjs | Tests that homework node layout and boundaries are documented. |
| pnpm-workspace.yaml | Adds homeworks/* to workspace; configures build allowances. |
| packages/ui/tsconfig.json | UI package TS config with React JSX + path mapping. |
| packages/ui/src/lib/utils.ts | Adds cn() helper (clsx + tailwind-merge). |
| packages/ui/src/hooks/.gitkeep | Placeholder for future shared hooks. |
| packages/ui/src/components/tooltip.tsx | Adds tooltip primitives wrapper component. |
| packages/ui/src/components/textarea.tsx | Adds shared textarea component. |
| packages/ui/src/components/sonner.tsx | Adds shared toaster wrapper for notifications. |
| packages/ui/src/components/skeleton.tsx | Adds shared skeleton component. |
| packages/ui/src/components/message.tsx | Adds shared message layout components. |
| packages/ui/src/components/marker.tsx | Adds shared “marker” component + variants. |
| packages/ui/src/components/label.tsx | Adds shared label component. |
| packages/ui/src/components/input.tsx | Adds shared input component (Base UI primitive). |
| packages/ui/src/components/empty.tsx | Adds shared empty-state components + variants. |
| packages/ui/src/components/checkbox.tsx | Adds shared checkbox component (Base UI primitive). |
| packages/ui/src/components/button.tsx | Adds shared button + variants. |
| packages/ui/postcss.config.mjs | UI package PostCSS config for Tailwind v4 plugin. |
| packages/ui/package.json | Defines UI package exports and dependencies. |
| packages/ui/components.json | shadcn registry/config for UI package. |
| packages/env/tsconfig.json | Env package TS config. |
| packages/env/src/web.ts | Web env helper module (t3-oss/env-core). |
| packages/env/package.json | Env package exports and dependencies. |
| packages/config/tsconfig.base.json | Shared strict TS base config. |
| packages/config/package.json | Config package metadata. |
| package.json | Root scripts expanded for monorepo checks/build/test + preview validation. |
| homeworks/04-rag-agent-orchestration/vitest.config.ts | Vitest config for the homework node. |
| homeworks/04-rag-agent-orchestration/tsconfig.json | TS config for the homework node. |
| homeworks/04-rag-agent-orchestration/training/verify_dataset.py | JSONL dataset structural verification script. |
| homeworks/04-rag-agent-orchestration/training/pyproject.toml | Python training environment spec. |
| homeworks/04-rag-agent-orchestration/training/preflight.py | CUDA/GPU/disk/PyTorch/LlamaFactory preflight checks. |
| homeworks/04-rag-agent-orchestration/training/dataset_info.json | LlamaFactory dataset metadata (ShareGPT format). |
| homeworks/04-rag-agent-orchestration/training/configs/qwen3-8b-smoke.yaml | Smoke QLoRA training config. |
| homeworks/04-rag-agent-orchestration/training/configs/qwen3-8b-incremental.yaml | Incremental QLoRA config with parent adapter. |
| homeworks/04-rag-agent-orchestration/training/collect_artifacts.py | Evidence/adaptor packaging into a zip with manifest. |
| homeworks/04-rag-agent-orchestration/tests/training-config.test.ts | Tests that training configs meet expectations. |
| homeworks/04-rag-agent-orchestration/tests/similarity.test.ts | Tests for near-duplicate similarity logic. |
| homeworks/04-rag-agent-orchestration/tests/safety.test.ts | Tests for outbound safety scanner and dedupe behavior. |
| homeworks/04-rag-agent-orchestration/tests/release.test.ts | Tests for dataset release schema + deterministic replay selection. |
| homeworks/04-rag-agent-orchestration/tests/quality.test.ts | Tests for formal dataset quality gates. |
| homeworks/04-rag-agent-orchestration/tests/formal-runner.test.ts | Tests for turning a chat response into a formal example. |
| homeworks/04-rag-agent-orchestration/tests/formal-generator.test.ts | Tests for parsing/selecting/building formal draft examples. |
| homeworks/04-rag-agent-orchestration/tests/evaluation-contract.test.ts | Tests that evidence schema excludes private prompt/response bodies. |
| homeworks/04-rag-agent-orchestration/tests/dataset-contract.test.ts | Tests for formal SFT schema parsing/normalization. |
| homeworks/04-rag-agent-orchestration/tests/coverage.test.ts | Tests for coverage report calculation. |
| homeworks/04-rag-agent-orchestration/tests/corpus.test.ts | Tests for corpus discovery + manifest destination safety. |
| homeworks/04-rag-agent-orchestration/tests/bundle.test.ts | Tests for upload bundle allowlist enforcement. |
| homeworks/04-rag-agent-orchestration/src/evidence/schema.ts | Zod schema for evaluation evidence rows. |
| homeworks/04-rag-agent-orchestration/src/dataset/review.ts | Reviewed-example validation + export safety checks. |
| homeworks/04-rag-agent-orchestration/src/dataset/release.ts | Dataset release schema + replay selection logic. |
| homeworks/04-rag-agent-orchestration/src/dataset/quality.ts | Formal dataset quality assertions. |
| homeworks/04-rag-agent-orchestration/src/dataset/leakage.ts | Leakage checks across splits (IDs/sources/near-duplicates). |
| homeworks/04-rag-agent-orchestration/src/dataset/formal-runner.ts | Formal draft orchestration runner. |
| homeworks/04-rag-agent-orchestration/src/dataset/coverage.ts | Coverage measurement and percentile reporting. |
| homeworks/04-rag-agent-orchestration/src/corpus/types.ts | Types for corpus scanning/discovery. |
| homeworks/04-rag-agent-orchestration/src/corpus/safety.ts | Outbound safety scanner for secrets/PII patterns. |
| homeworks/04-rag-agent-orchestration/src/corpus/manifest.ts | Manifest writer with strict boundary enforcement. |
| homeworks/04-rag-agent-orchestration/src/corpus/discover.ts | Markdown discovery with hashing + metadata collection. |
| homeworks/04-rag-agent-orchestration/src/corpus/deduplicate.ts | Hash-based deduplication logic. |
| homeworks/04-rag-agent-orchestration/README.md | Homework node overview + strict boundaries. |
| homeworks/04-rag-agent-orchestration/package.json | Homework node scripts + dependencies. |
| homeworks/04-rag-agent-orchestration/docs/uu-runbook.md | Remote NVIDIA/CUDA training runbook + budget gates. |
| homeworks/04-rag-agent-orchestration/docs/training-evidence.md | Evidence policy and status tracking doc. |
| homeworks/04-rag-agent-orchestration/docs/local-preparation-2026-08-02.md | Local preparation log and boundary assertions. |
| homeworks/04-rag-agent-orchestration/docs/incremental-training.md | Incremental release/training guidance. |
| homeworks/04-rag-agent-orchestration/data/seeds/agent-capabilities.jsonl | Seed examples for capabilities dataset. |
| homeworks/04-rag-agent-orchestration/data/README.md | Boundary doc for dataset directory. |
| homeworks/04-rag-agent-orchestration/artifacts/README.md | Boundary doc + hash-only artifact evidence. |
| docs/superpowers/specs/2026-07-29-cloudflare-pr-preview-design.md | Full Cloudflare preview design doc. |
| bts.jsonc | Better-T-Stack metadata snapshot. |
| biome.json | Biome configuration updates (includes + preset field). |
| apps/web/vite.config.ts | Adds /api proxy target configuration. |
| apps/web/tsconfig.json | Updates TS config + path mapping for UI package. |
| apps/web/src/test/setup.ts | Testing Library cleanup setup for vitest. |
| apps/web/src/routes/moments.tsx | Adds /moments route. |
| apps/web/src/routes/me.tsx | Adds /me route. |
| apps/web/src/routes/index.tsx | Redirect / to /growth. |
| apps/web/src/routes/homework.github-profile.tsx | Adds /homework/github-profile route. |
| apps/web/src/routes/guide.tsx | Adds /guide route. |
| apps/web/src/routes/growth.tsx | Adds /growth route. |
| apps/web/src/routes/__root.tsx | Root route shell + HeadContent + Toaster. |
| apps/web/src/main.tsx | Router creation + app mount logic. |
| apps/web/src/lib/cn.ts | Re-export cn() from UI package. |
| apps/web/src/index.css | Imports shared UI globals. |
| apps/web/src/features/nurture/types.ts | Local domain types for nurture feature. |
| apps/web/src/features/nurture/profile-content.tsx | Adds navigation entry to GitHub profile homework route. |
| apps/web/src/features/nurture/data.ts | Adds local fixture data for nurture feature. |
| apps/web/src/features/nurture/tests/local-interactions.test.tsx | Tests local UI interactions (no backend). |
| apps/web/src/features/github-profile/github-profile-api.ts | Browser client for GitHub profile endpoints with safe errors. |
| apps/web/src/features/github-profile/github-profile-api.test.ts | Tests for API client behavior and error mapping. |
| apps/web/src/components/ui/status-chip.tsx | Shared status-chip component. |
| apps/web/src/components/ui/section-header.tsx | Shared section header component. |
| apps/web/src/components/ui/modal.tsx | Accessible modal component. |
| apps/web/src/components/ui/floating-action-button.tsx | Floating action button component. |
| apps/web/src/components/ui/tests/ui-components.test.tsx | Tests for shared UI components. |
| apps/web/src/components/theme-provider.tsx | Theme provider wrapper + useTheme re-export. |
| apps/web/src/components/mode-toggle.tsx | Theme toggle dropdown UI. |
| apps/web/src/components/loader.tsx | Pending/loading component. |
| apps/web/src/components/layout/top-bar.tsx | App top navigation bar. |
| apps/web/src/components/layout/bottom-nav.tsx | Bottom nav using router links + active semantics. |
| apps/web/src/components/layout/app-shell.tsx | Shell wiring for top bar, outlet, bottom nav. |
| apps/web/src/components/header.tsx | Header component (includes theme toggle). |
| apps/web/src/components/app-identity.tsx | Visible product identity component. |
| apps/web/src/components/tests/app-identity.test.tsx | AppIdentity visibility test. |
| apps/web/README.md | Updated web README with commands + preview URL + boundary notes. |
| apps/web/package.json | Restructures web package metadata + deps/scripts. |
| apps/web/index.html | Adds Vite HTML entrypoint. |
| apps/web/components.json | shadcn config for app-level components. |
| apps/web/apps/web/tsconfig.json | Removes nested app TS config (flattening). |
| apps/web/apps/web/package.json | Removes nested app package (flattening). |
| apps/web/apps/web/.gitignore | Removes nested app gitignore (flattening). |
| apps/web/.gitignore | Adjusts generated route tree + local vars ignore. |
| apps/README.md | Clarifies app boundaries and root commands. |
| apps/api/vitest.config.ts | Vitest config for API package. |
| apps/api/tsup.config.ts | Build config for API server bundling. |
| apps/api/tsconfig.json | TS config for API package. |
| apps/api/src/server.ts | Local Hono server bootstrap with migrations and shutdown. |
| apps/api/src/errors/app-error.ts | Safe AppError wrapper that serializes stable response bodies. |
| apps/api/src/errors/app-error.test.ts | Tests safe error serialization. |
| apps/api/src/env.ts | Zod-based server env parsing with non-secret defaults. |
| apps/api/src/env.test.ts | Tests env defaults and validation. |
| apps/api/src/db/schema.ts | Drizzle schema for GitHub profiles. |
| apps/api/src/db/profile-repository.ts | Profile repository (findLatest + upsert). |
| apps/api/src/db/profile-repository.test.ts | Repository tests with in-memory DB + migrations. |
| apps/api/src/db/migration-runner.ts | Migration helpers for runtime and file-based DB. |
| apps/api/src/db/migrate.ts | CLI migration entrypoint. |
| apps/api/src/db/database.ts | SQLite + Drizzle database initialization. |
| apps/api/src/contracts/github-profile.ts | Shared GitHub profile contract schemas and types. |
| apps/api/src/contracts/github-profile.test.ts | Contract validation tests. |
| apps/api/src/auth/keychain-token-provider.ts | macOS Keychain token provider with safe error mapping. |
| apps/api/src/auth/keychain-token-provider.test.ts | Token provider tests. |
| apps/api/src/app.ts | Hono routes and error handling for GitHub profile homework. |
| apps/api/README.md | API homework README with credential boundary guidance. |
| apps/api/package.json | API package scripts, exports, deps. |
| apps/api/drizzle/20260731160930_remove_location/migration.sql | Migration: drop location. |
| apps/api/drizzle/20260731160918_add_profile_metrics/migration.sql | Migration: add bio/metrics + rebuild table. |
| apps/api/drizzle/20260731160853_create_github_profiles/migration.sql | Initial GitHub profiles table creation migration. |
| apps/api/drizzle.config.ts | Drizzle-kit config. |
| apps/api/.env.example | Non-secret env example for local dev. |
| apps/api-go/README.md | Go API homework README and boundary notes. |
| apps/api-go/package.json | Go package scripts wired into pnpm. |
| apps/api-go/internal/testdb/testdb.go | Test DB helper applying migrations. |
| apps/api-go/internal/keychain/provider.go | Keychain token provider (Go) with bounded output. |
| apps/api-go/internal/contracts/profile.go | JSON contract parsing + trimming rules (Go). |
| apps/api-go/internal/config/config_test.go | Config loading tests (Go). |
| apps/api-go/internal/apperror/error.go | Safe error envelope (Go). |
| apps/api-go/internal/apperror/error_test.go | Tests safe error envelope (Go). |
| apps/api-go/go.mod | Go module definition and dependencies. |
| apps/api-go/cmd/server/main.go | Go API server entrypoint + graceful shutdown. |
| apps/api-go/cmd/migrate/main.go | Go DB migration CLI entrypoint. |
| AGENTS.md | Working agreement documentation added to repo root. |
| .tc-flow/stop-hook-result.json | TC Flow artifact update for preview feature run. |
| .tc-flow/run-result.json | TC Flow run artifact update for preview feature. |
| .tc-flow/run-memory.md | TC Flow run memory update for preview feature. |
| .tc-flow/reviews/T-003.sanitized.diff | Sanitized review artifact update. |
| .tc-flow/reviews/T-003.review-result.json | Review result artifact update. |
| .tc-flow/reviews/T-003.review-bundle.json | Review bundle artifact update. |
| .tc-flow/reviews/T-002.review-result.json | Review result artifact update. |
| .tc-flow/reviews/T-002.review-bundle.json | Review bundle artifact update. |
| .tc-flow/reviews/T-001.review-result.json | Review result artifact update. |
| .tc-flow/reviews/T-001.review-bundle.json | Review bundle artifact update. |
| .tc-flow/reviews/FEATURE-STOP.review-result.json | Feature-stop review result artifact update. |
| .tc-flow/reviews/FEATURE-STOP.review-bundle.json | Feature-stop review bundle artifact update. |
| .tc-flow/qa/feature-result.json | Feature QA artifact update. |
| .tc-flow/memory/INDEX.md | Adds index entry for preview feature memory. |
| .tc-flow/memory/cloudflare-pr-preview-aa5d84f9.md | Preview feature memory doc. |
| .tc-flow/checkpoints/cloudflare-T-003.json | Checkpoint artifact for T-003. |
| .tc-flow/checkpoints/cloudflare-T-002.json | Checkpoint artifact for T-002. |
| .tc-flow/checkpoints/cloudflare-T-001.json | Checkpoint artifact for T-001. |
| .gitignore | Adds ignores for training/private state + local API sqlite + Go build output. |
| .github/workflows/cloudflare-preview.yml | Adds CI workflow to test/build/deploy stable Cloudflare preview. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Testing