agentic-dev 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/prd.json +29 -0
- package/.agent/progress.txt +1 -0
- package/.agent/prompt.md +21 -0
- package/.agent/ralph-loop-state.json +13 -0
- package/.agent/ralph-supervisor-state.json +12 -0
- package/.agent/ralph-supervisor.sh +238 -0
- package/.agent/ralph.sh +305 -0
- package/.agent/runs/README.md +7 -0
- package/.agent/sdd-build-ast-audit.json +13 -0
- package/.claude/CLAUDE.md +44 -0
- package/.claude/agentic-dev.json +3 -0
- package/.claude/agents/ai-dev.md +27 -0
- package/.claude/agents/backend-dev.md +26 -0
- package/.claude/agents/db-dev.md +26 -0
- package/.claude/agents/devops.md +27 -0
- package/.claude/agents/frontend-dev.md +25 -0
- package/.claude/agents/github-ops.md +25 -0
- package/.claude/agents/test-dev.md +26 -0
- package/.claude/agents/uiux-designer.md +25 -0
- package/.claude/settings.json +49 -0
- package/.claude/settings.local.json +8 -0
- package/.claude/skills/commit/SKILL.md +37 -0
- package/.claude/skills/dev-browser/SKILL.md +30 -0
- package/.claude/skills/otro/SKILL.md +43 -0
- package/.claude/skills/planning-with-files/SKILL.md +37 -0
- package/.claude/skills/prd/SKILL.md +27 -0
- package/.claude/skills/ralph-loop/SKILL.md +42 -0
- package/.claude/skills/sdd/SKILL.md +13 -0
- package/.claude/skills/sdd-dev/SKILL.md +71 -0
- package/.claude/skills/sdd-development/SKILL.md +13 -0
- package/.claude/workspace-config.json +3 -0
- package/.codex/agentic-dev.json +3 -0
- package/.codex/agents/README.md +22 -0
- package/.codex/agents/api.toml +11 -0
- package/.codex/agents/architecture.toml +11 -0
- package/.codex/agents/ci.toml +11 -0
- package/.codex/agents/gitops.toml +11 -0
- package/.codex/agents/orchestrator.toml +11 -0
- package/.codex/agents/quality.toml +11 -0
- package/.codex/agents/runtime.toml +11 -0
- package/.codex/agents/security.toml +11 -0
- package/.codex/agents/specs.toml +11 -0
- package/.codex/agents/ui.toml +11 -0
- package/.codex/config.toml +46 -0
- package/.codex/skills/SKILL.md +13 -0
- package/.codex/skills/agents/openai.yaml +4 -0
- package/.codex/skills/commit/SKILL.md +219 -0
- package/.codex/skills/commit/references/commit_examples.md +292 -0
- package/.codex/skills/dev-browser/SKILL.md +211 -0
- package/.codex/skills/dev-browser/bun.lock +443 -0
- package/.codex/skills/dev-browser/package-lock.json +2988 -0
- package/.codex/skills/dev-browser/package.json +31 -0
- package/.codex/skills/dev-browser/references/scraping.md +155 -0
- package/.codex/skills/dev-browser/scripts/start-relay.ts +32 -0
- package/.codex/skills/dev-browser/scripts/start-server.ts +117 -0
- package/.codex/skills/dev-browser/server.sh +24 -0
- package/.codex/skills/dev-browser/src/client.ts +474 -0
- package/.codex/skills/dev-browser/src/index.ts +287 -0
- package/.codex/skills/dev-browser/src/relay.ts +731 -0
- package/.codex/skills/dev-browser/src/snapshot/__tests__/snapshot.test.ts +223 -0
- package/.codex/skills/dev-browser/src/snapshot/browser-script.ts +877 -0
- package/.codex/skills/dev-browser/src/snapshot/index.ts +14 -0
- package/.codex/skills/dev-browser/src/snapshot/inject.ts +13 -0
- package/.codex/skills/dev-browser/src/types.ts +34 -0
- package/.codex/skills/dev-browser/tsconfig.json +36 -0
- package/.codex/skills/dev-browser/vitest.config.ts +12 -0
- package/.codex/skills/otro/SKILL.md +74 -0
- package/.codex/skills/otro/agents/openai.yaml +4 -0
- package/.codex/skills/otro/references/agent-prompts.md +61 -0
- package/.codex/skills/otro/references/contracts.md +146 -0
- package/.codex/skills/otro/references/orchestration-loop.md +51 -0
- package/.codex/skills/otro/references/runtime.md +79 -0
- package/.codex/skills/otro/runs/README.md +11 -0
- package/.codex/skills/otro/schemas/step_plan.schema.json +289 -0
- package/.codex/skills/otro/schemas/task_result.schema.json +142 -0
- package/.codex/skills/otro/schemas/wave_plan.schema.json +4 -0
- package/.codex/skills/otro/scripts/README.md +38 -0
- package/.codex/skills/otro/scripts/bump_validation_header.py +179 -0
- package/.codex/skills/otro/scripts/check_validation_header.py +84 -0
- package/.codex/skills/otro/scripts/common.py +303 -0
- package/.codex/skills/otro/scripts/init_run.sh +68 -0
- package/.codex/skills/otro/scripts/plan_loop.py +8 -0
- package/.codex/skills/otro/scripts/plan_step.py +367 -0
- package/.codex/skills/otro/scripts/plan_wave.py +8 -0
- package/.codex/skills/otro/scripts/reconcile_loop.py +8 -0
- package/.codex/skills/otro/scripts/reconcile_step.py +37 -0
- package/.codex/skills/otro/scripts/reconcile_wave.py +8 -0
- package/.codex/skills/otro/scripts/run_loop.py +300 -0
- package/.codex/skills/otro/scripts/run_loop_step.py +8 -0
- package/.codex/skills/otro/scripts/run_step.py +246 -0
- package/.codex/skills/otro/scripts/run_wave.py +8 -0
- package/.codex/skills/otro/validation/validation.md +15 -0
- package/.codex/skills/planning-with-files/SKILL.md +42 -0
- package/.codex/skills/planning-with-files/agents/openai.yaml +4 -0
- package/.codex/skills/planning-with-files/assets/plan-template.md +37 -0
- package/.codex/skills/planning-with-files/references/plan-rules.md +35 -0
- package/.codex/skills/planning-with-files/scripts/new_plan.sh +65 -0
- package/.codex/skills/prd/SKILL.md +235 -0
- package/.codex/skills/ralph-loop/SKILL.md +46 -0
- package/.codex/skills/ralph-loop/agents/openai.yaml +4 -0
- package/.codex/skills/ralph-loop/references/failure-triage.md +32 -0
- package/.codex/skills/ralph-loop/scripts/loop_until_success.sh +97 -0
- package/.codex/skills/sdd/SKILL.md +184 -0
- package/.codex/skills/sdd/agents/openai.yaml +4 -0
- package/.codex/skills/sdd/references/section-map.md +67 -0
- package/.dockerignore +8 -0
- package/.env.example +50 -0
- package/.gitignore +16 -0
- package/AGENTS.md +78 -0
- package/README.md +83 -47
- package/SDD_SKILL.md +589 -0
- package/bin/agentic-dev.mjs +97 -0
- package/client/admin/.dockerignore +3 -0
- package/client/admin/.env.example +1 -0
- package/client/admin/Dockerfile +16 -0
- package/client/admin/Dockerfile.dev +18 -0
- package/client/admin/README.md +20 -0
- package/client/admin/index.html +12 -0
- package/client/admin/package.json +41 -0
- package/client/admin/postcss.config.js +6 -0
- package/client/admin/scripts/ui-parity-admin-adapter.mjs +65 -0
- package/client/admin/src/api/alerts.ts +33 -0
- package/client/admin/src/api/client.ts +71 -0
- package/client/admin/src/api/orders.ts +33 -0
- package/client/admin/src/api/support.ts +11 -0
- package/client/admin/src/app/App.tsx +23 -0
- package/client/admin/src/auth/AuthProvider.tsx +122 -0
- package/client/admin/src/auth/ProtectedRoute.tsx +22 -0
- package/client/admin/src/auth/auth-client.ts +38 -0
- package/client/admin/src/auth/types.ts +18 -0
- package/client/admin/src/components/AdminNotificationsDrawer.tsx +162 -0
- package/client/admin/src/components/AdminShell.tsx +76 -0
- package/client/admin/src/components/ui/button.tsx +34 -0
- package/client/admin/src/components/ui/input.tsx +21 -0
- package/client/admin/src/lib/cn.ts +6 -0
- package/client/admin/src/lib/specRouteCatalog.json +30 -0
- package/client/admin/src/lib/specScreens.json +22 -0
- package/client/admin/src/main.tsx +17 -0
- package/client/admin/src/pages/AdminDashboardPage.tsx +171 -0
- package/client/admin/src/pages/AdminLoginPage.tsx +75 -0
- package/client/admin/src/pages/AdminQueuePage.tsx +107 -0
- package/client/admin/src/pages/AdminSupportPage.tsx +61 -0
- package/client/admin/src/styles/globals.css +17 -0
- package/client/admin/src/theme-vars.ts +18 -0
- package/client/admin/src/theme.ts +25 -0
- package/client/admin/src/vite-env.d.ts +1 -0
- package/client/admin/tailwind.config.js +8 -0
- package/client/admin/tsconfig.json +25 -0
- package/client/admin/vite.config.ts +12 -0
- package/client/landing/.dockerignore +3 -0
- package/client/landing/.env.example +1 -0
- package/client/landing/Dockerfile +16 -0
- package/client/landing/Dockerfile.dev +18 -0
- package/client/landing/README.md +18 -0
- package/client/landing/index.html +12 -0
- package/client/landing/package.json +41 -0
- package/client/landing/postcss.config.js +6 -0
- package/client/landing/scripts/ui-parity-landing-adapter.mjs +65 -0
- package/client/landing/src/App.tsx +21 -0
- package/client/landing/src/api/catalog.ts +30 -0
- package/client/landing/src/api/client.ts +30 -0
- package/client/landing/src/auth/AuthProvider.tsx +122 -0
- package/client/landing/src/auth/ProtectedRoute.tsx +22 -0
- package/client/landing/src/auth/auth-client.ts +38 -0
- package/client/landing/src/auth/types.ts +18 -0
- package/client/landing/src/components/LandingShell.tsx +34 -0
- package/client/landing/src/lib/specRouteCatalog.json +23 -0
- package/client/landing/src/lib/specScreens.json +17 -0
- package/client/landing/src/main.tsx +17 -0
- package/client/landing/src/pages/LandingHomePage.tsx +215 -0
- package/client/landing/src/pages/LandingLoginPage.tsx +90 -0
- package/client/landing/src/pages/LandingWorkspacePage.tsx +126 -0
- package/client/landing/src/styles/globals.css +17 -0
- package/client/landing/src/theme-vars.ts +16 -0
- package/client/landing/src/theme.ts +21 -0
- package/client/landing/src/vite-env.d.ts +1 -0
- package/client/landing/tailwind.config.js +8 -0
- package/client/landing/tsconfig.json +25 -0
- package/client/landing/vite.config.ts +12 -0
- package/client/mobile/.dockerignore +2 -0
- package/client/mobile/.env.example +1 -0
- package/client/mobile/Dockerfile +16 -0
- package/client/mobile/Dockerfile.dev +18 -0
- package/client/mobile/README.md +19 -0
- package/client/mobile/index.html +12 -0
- package/client/mobile/package.json +42 -0
- package/client/mobile/postcss.config.js +6 -0
- package/client/mobile/scripts/ui-parity-mobile-adapter.mjs +67 -0
- package/client/mobile/src/App.tsx +1 -0
- package/client/mobile/src/api/client.ts +62 -0
- package/client/mobile/src/api/fulfillment.ts +55 -0
- package/client/mobile/src/api/shipping.ts +56 -0
- package/client/mobile/src/app/App.tsx +23 -0
- package/client/mobile/src/auth/AuthProvider.tsx +122 -0
- package/client/mobile/src/auth/ProtectedRoute.tsx +27 -0
- package/client/mobile/src/auth/auth-client.ts +38 -0
- package/client/mobile/src/auth/types.ts +18 -0
- package/client/mobile/src/components/InShell.tsx +74 -0
- package/client/mobile/src/components/ui/button.tsx +35 -0
- package/client/mobile/src/components/ui/card.tsx +15 -0
- package/client/mobile/src/components/ui/input.tsx +21 -0
- package/client/mobile/src/lib/cn.ts +6 -0
- package/client/mobile/src/lib/specRouteCatalog.json +26 -0
- package/client/mobile/src/lib/specScreens.json +22 -0
- package/client/mobile/src/lib/useSpeechRecognitionInput.ts +271 -0
- package/client/mobile/src/main.tsx +17 -0
- package/client/mobile/src/pages/DashboardPage.tsx +172 -0
- package/client/mobile/src/pages/FulfillmentPage.tsx +138 -0
- package/client/mobile/src/pages/LoginPage.tsx +74 -0
- package/client/mobile/src/pages/ShippingPage.tsx +338 -0
- package/client/mobile/src/styles/globals.css +23 -0
- package/client/mobile/src/theme-vars.ts +16 -0
- package/client/mobile/src/theme.ts +21 -0
- package/client/mobile/src/vite-env.d.ts +1 -0
- package/client/mobile/tailwind.config.js +8 -0
- package/client/mobile/tsconfig.json +25 -0
- package/client/mobile/vite.config.ts +12 -0
- package/client/platform/.dockerignore +3 -0
- package/client/platform/.env.example +1 -0
- package/client/platform/Dockerfile +16 -0
- package/client/platform/Dockerfile.dev +18 -0
- package/client/platform/README.md +47 -0
- package/client/platform/index.html +12 -0
- package/client/platform/package.json +42 -0
- package/client/platform/postcss.config.js +6 -0
- package/client/platform/scripts/ui-parity-platform-adapter.mjs +66 -0
- package/client/platform/src/api/client.ts +30 -0
- package/client/platform/src/api/orders.ts +42 -0
- package/client/platform/src/app/App.tsx +21 -0
- package/client/platform/src/auth/AuthProvider.tsx +122 -0
- package/client/platform/src/auth/ProtectedRoute.tsx +22 -0
- package/client/platform/src/auth/auth-client.ts +38 -0
- package/client/platform/src/auth/types.ts +18 -0
- package/client/platform/src/components/AppShell.tsx +59 -0
- package/client/platform/src/components/ui/button.tsx +35 -0
- package/client/platform/src/components/ui/card.tsx +7 -0
- package/client/platform/src/components/ui/input.tsx +21 -0
- package/client/platform/src/lib/cn.ts +6 -0
- package/client/platform/src/lib/specRouteCatalog.json +23 -0
- package/client/platform/src/lib/specScreens.json +17 -0
- package/client/platform/src/main.tsx +17 -0
- package/client/platform/src/pages/DashboardPage.tsx +158 -0
- package/client/platform/src/pages/LoginPage.tsx +72 -0
- package/client/platform/src/pages/OrdersPage.tsx +123 -0
- package/client/platform/src/styles/globals.css +17 -0
- package/client/platform/src/theme-vars.ts +18 -0
- package/client/platform/src/theme.ts +25 -0
- package/client/platform/src/vite-env.d.ts +1 -0
- package/client/platform/tailwind.config.js +8 -0
- package/client/platform/tsconfig.json +25 -0
- package/client/platform/vite.config.ts +12 -0
- package/compose.yml +206 -0
- package/infra/compose/.env.dev.example +28 -0
- package/infra/compose/.env.prod.example +29 -0
- package/infra/compose/README.md +35 -0
- package/infra/compose/dev.yml +125 -0
- package/infra/compose/prod.yml +126 -0
- package/infra/terraform/README.md +34 -0
- package/infra/terraform/aws/data/.terraform.lock.hcl +25 -0
- package/infra/terraform/aws/data/README.md +18 -0
- package/infra/terraform/aws/data/main.tf +147 -0
- package/infra/terraform/aws/data/outputs.tf +14 -0
- package/infra/terraform/aws/data/variables.tf +57 -0
- package/infra/terraform/aws/data/versions.tf +10 -0
- package/infra/terraform/aws/domain/.terraform.lock.hcl +25 -0
- package/infra/terraform/aws/domain/README.md +20 -0
- package/infra/terraform/aws/domain/env/dev.tfvars.example +6 -0
- package/infra/terraform/aws/domain/env/prod.tfvars.example +7 -0
- package/infra/terraform/aws/domain/main.tf +149 -0
- package/infra/terraform/aws/domain/outputs.tf +29 -0
- package/infra/terraform/aws/domain/variables.tf +58 -0
- package/infra/terraform/aws/domain/versions.tf +10 -0
- package/infra/terraform/openstack/README.md +38 -0
- package/infra/terraform/openstack/dev/.terraform.lock.hcl +24 -0
- package/infra/terraform/openstack/dev/README.md +18 -0
- package/infra/terraform/openstack/dev/main.tf +49 -0
- package/infra/terraform/openstack/dev/providers.tf +15 -0
- package/infra/terraform/openstack/dev/terraform.tfvars.example +54 -0
- package/infra/terraform/openstack/dev/variables.tf +210 -0
- package/infra/terraform/openstack/dev/versions.tf +10 -0
- package/infra/terraform/openstack/modules/environment_host/main.tf +143 -0
- package/infra/terraform/openstack/modules/environment_host/outputs.tf +25 -0
- package/infra/terraform/openstack/modules/environment_host/templates/docker-host-user-data.sh.tftpl +40 -0
- package/infra/terraform/openstack/modules/environment_host/variables.tf +145 -0
- package/infra/terraform/openstack/modules/environment_host/versions.tf +7 -0
- package/infra/terraform/openstack/prod/.terraform.lock.hcl +24 -0
- package/infra/terraform/openstack/prod/README.md +18 -0
- package/infra/terraform/openstack/prod/main.tf +49 -0
- package/infra/terraform/openstack/prod/providers.tf +15 -0
- package/infra/terraform/openstack/prod/terraform.tfvars.example +55 -0
- package/infra/terraform/openstack/prod/variables.tf +210 -0
- package/infra/terraform/openstack/prod/versions.tf +10 -0
- package/infra/terraform/openstack/server/.terraform.lock.hcl +45 -0
- package/infra/terraform/openstack/server/README.md +47 -0
- package/infra/terraform/openstack/server/main.tf +161 -0
- package/infra/terraform/openstack/server/outputs.tf +30 -0
- package/infra/terraform/openstack/server/providers.tf +30 -0
- package/infra/terraform/openstack/server/templates/server-user-data.sh.tftpl +50 -0
- package/infra/terraform/openstack/server/variables.tf +233 -0
- package/infra/terraform/openstack/server/zz_aspace.auto.tfvars.example.json +29 -0
- package/lib/scaffold.mjs +379 -0
- package/package.json +33 -12
- package/pnpm-workspace.yaml +2 -0
- package/scripts/dev/audit_sdd_build_ast.py +277 -0
- package/sdd/01_planning/01_feature/INDEX.md +16 -0
- package/sdd/01_planning/01_feature/README.md +76 -0
- package/sdd/01_planning/01_feature/alerts_feature_spec.md +55 -0
- package/sdd/01_planning/01_feature/auth_feature_spec.md +57 -0
- package/sdd/01_planning/01_feature/catalog_feature_spec.md +61 -0
- package/sdd/01_planning/01_feature/fulfillment_feature_spec.md +58 -0
- package/sdd/01_planning/01_feature/health_feature_spec.md +52 -0
- package/sdd/01_planning/01_feature/inventory_feature_spec.md +60 -0
- package/sdd/01_planning/01_feature/order_feature_spec.md +63 -0
- package/sdd/01_planning/01_feature/shipping_feature_spec.md +55 -0
- package/sdd/01_planning/01_feature/support_feature_spec.md +53 -0
- package/sdd/01_planning/01_feature/user_feature_spec.md +54 -0
- package/sdd/01_planning/02_screen/INDEX.md +13 -0
- package/sdd/01_planning/02_screen/README.md +41 -0
- package/sdd/01_planning/02_screen/admin_screen_spec.pdf +0 -0
- package/sdd/01_planning/02_screen/assets/README.md +16 -0
- package/sdd/01_planning/02_screen/assets/example/README.md +13 -0
- package/sdd/01_planning/02_screen/landing_screen_spec.pdf +0 -0
- package/sdd/01_planning/02_screen/mobile_screen_spec.pdf +0 -0
- package/sdd/01_planning/02_screen/platform_screen_spec.pdf +0 -0
- package/sdd/01_planning/03_architecture/INDEX.md +9 -0
- package/sdd/01_planning/03_architecture/README.md +25 -0
- package/sdd/01_planning/03_architecture/architecture_document_structure.md +77 -0
- package/sdd/01_planning/03_architecture/backend/README.md +10 -0
- package/sdd/01_planning/03_architecture/frontend/README.md +12 -0
- package/sdd/01_planning/03_architecture/infra/README.md +10 -0
- package/sdd/01_planning/03_architecture/tech-research/README.md +4 -0
- package/sdd/01_planning/03_architecture/templates_system_architecture.md +84 -0
- package/sdd/01_planning/04_data/INDEX.md +4 -0
- package/sdd/01_planning/04_data/README.md +10 -0
- package/sdd/01_planning/04_data/templates_data_modeling.md +119 -0
- package/sdd/01_planning/05_api/README.md +12 -0
- package/sdd/01_planning/05_api/templates_api_contract.md +90 -0
- package/sdd/01_planning/06_iac/README.md +11 -0
- package/sdd/01_planning/06_iac/templates_runtime_and_cicd_baseline.md +46 -0
- package/sdd/01_planning/07_integration/README.md +11 -0
- package/sdd/01_planning/07_integration/templates_frontend_api_integration.md +46 -0
- package/sdd/01_planning/08_nonfunctional/README.md +7 -0
- package/sdd/01_planning/09_security/README.md +7 -0
- package/sdd/01_planning/10_test/README.md +12 -0
- package/sdd/01_planning/10_test/templates_test_strategy.md +60 -0
- package/sdd/01_planning/INDEX.md +19 -0
- package/sdd/01_planning/README.md +17 -0
- package/sdd/02_plan/01_feature/README.md +34 -0
- package/sdd/02_plan/01_feature/_feature_todo_template.md +29 -0
- package/sdd/02_plan/02_screen/INDEX.md +19 -0
- package/sdd/02_plan/02_screen/README.md +39 -0
- package/sdd/02_plan/02_screen/_screen_todo_template.md +60 -0
- package/sdd/02_plan/03_architecture/README.md +23 -0
- package/sdd/02_plan/03_architecture/architecture_document_governance.md +40 -0
- package/sdd/02_plan/03_architecture/build_ast_runtime_tree_governance.md +53 -0
- package/sdd/02_plan/03_architecture/repository_governance.md +39 -0
- package/sdd/02_plan/03_architecture/runtime_and_structure_governance.md +38 -0
- package/sdd/02_plan/03_architecture/templates-hexagonal-template-architecture.md +9 -0
- package/sdd/02_plan/03_architecture/toolchain_governance.md +98 -0
- package/sdd/02_plan/04_data/README.md +5 -0
- package/sdd/02_plan/05_api/README.md +5 -0
- package/sdd/02_plan/06_iac/README.md +11 -0
- package/sdd/02_plan/06_iac/dev_runtime_delivery.md +36 -0
- package/sdd/02_plan/06_iac/template_runtime_delivery.md +50 -0
- package/sdd/02_plan/07_integration/README.md +5 -0
- package/sdd/02_plan/07_integration/frontend_live_integration.md +31 -0
- package/sdd/02_plan/08_nonfunctional/README.md +5 -0
- package/sdd/02_plan/08_nonfunctional/repository_hygiene.md +26 -0
- package/sdd/02_plan/09_security/README.md +5 -0
- package/sdd/02_plan/10_test/README.md +11 -0
- package/sdd/02_plan/10_test/regression_verification.md +39 -0
- package/sdd/02_plan/10_test/templates/README.md +8 -0
- package/sdd/02_plan/10_test/templates/ui_parity_platform_contract.template.yaml +23 -0
- package/sdd/02_plan/10_test/verification_strategy.md +43 -0
- package/sdd/02_plan/99_generated/from_planning/ui_parity/.gitkeep +1 -0
- package/sdd/02_plan/README.md +40 -0
- package/sdd/03_build/01_feature/README.md +20 -0
- package/sdd/03_build/01_feature/domain/README.md +3 -0
- package/sdd/03_build/01_feature/domain/account_and_access.md +20 -0
- package/sdd/03_build/01_feature/domain/catalog_and_inventory.md +20 -0
- package/sdd/03_build/01_feature/domain/ordering_and_fulfillment.md +21 -0
- package/sdd/03_build/01_feature/domain/support_and_observability.md +21 -0
- package/sdd/03_build/01_feature/domain_surfaces.md +28 -0
- package/sdd/03_build/01_feature/service/README.md +3 -0
- package/sdd/03_build/01_feature/service/admin_surface.md +15 -0
- package/sdd/03_build/01_feature/service/landing_surface.md +13 -0
- package/sdd/03_build/01_feature/service/mobile_surface.md +14 -0
- package/sdd/03_build/01_feature/service/platform_surface.md +14 -0
- package/sdd/03_build/02_screen/README.md +25 -0
- package/sdd/03_build/02_screen/_screen_build_template.md +26 -0
- package/sdd/03_build/02_screen/admin/README.md +5 -0
- package/sdd/03_build/02_screen/landing/README.md +5 -0
- package/sdd/03_build/02_screen/mobile/README.md +5 -0
- package/sdd/03_build/02_screen/platform/README.md +5 -0
- package/sdd/03_build/03_architecture/README.md +10 -0
- package/sdd/03_build/03_architecture/architecture_document_governance.md +30 -0
- package/sdd/03_build/03_architecture/build_ast_runtime_tree_governance.md +24 -0
- package/sdd/03_build/03_architecture/repository_governance.md +18 -0
- package/sdd/03_build/03_architecture/toolchain_governance.md +36 -0
- package/sdd/03_build/06_iac/README.md +3 -0
- package/sdd/03_build/06_iac/dev_runtime_delivery.md +10 -0
- package/sdd/03_build/06_iac/template_runtime_delivery.md +49 -0
- package/sdd/03_build/07_integration/README.md +3 -0
- package/sdd/03_build/07_integration/frontend_live_integration.md +11 -0
- package/sdd/03_build/08_nonfunctional/README.md +3 -0
- package/sdd/03_build/08_nonfunctional/repository_hygiene.md +10 -0
- package/sdd/03_build/10_test/README.md +9 -0
- package/sdd/03_build/10_test/regression_verification.md +16 -0
- package/sdd/03_build/10_test/verification_harness.md +11 -0
- package/sdd/03_build/README.md +35 -0
- package/sdd/04_verify/01_feature/README.md +5 -0
- package/sdd/04_verify/01_feature/domain_verification.md +14 -0
- package/sdd/04_verify/01_feature/service_verification.md +22 -0
- package/sdd/04_verify/02_screen/README.md +6 -0
- package/sdd/04_verify/02_screen/_screen_verify_template.md +20 -0
- package/sdd/04_verify/02_screen/admin/README.md +4 -0
- package/sdd/04_verify/02_screen/landing/README.md +4 -0
- package/sdd/04_verify/02_screen/mobile/README.md +4 -0
- package/sdd/04_verify/02_screen/platform/README.md +4 -0
- package/sdd/04_verify/03_architecture/README.md +10 -0
- package/sdd/04_verify/03_architecture/architecture_document_governance.md +15 -0
- package/sdd/04_verify/03_architecture/build_ast_runtime_tree_governance.md +28 -0
- package/sdd/04_verify/03_architecture/repository_governance.md +16 -0
- package/sdd/04_verify/03_architecture/toolchain_governance.md +58 -0
- package/sdd/04_verify/06_iac/README.md +3 -0
- package/sdd/04_verify/06_iac/dev_runtime_delivery.md +10 -0
- package/sdd/04_verify/06_iac/template_runtime_delivery.md +42 -0
- package/sdd/04_verify/07_integration/README.md +3 -0
- package/sdd/04_verify/07_integration/frontend_live_integration.md +16 -0
- package/sdd/04_verify/08_nonfunctional/README.md +3 -0
- package/sdd/04_verify/08_nonfunctional/repository_hygiene.md +14 -0
- package/sdd/04_verify/10_test/README.md +9 -0
- package/sdd/04_verify/10_test/regression_verification.md +16 -0
- package/sdd/04_verify/10_test/ui_parity/README.md +4 -0
- package/sdd/04_verify/10_test/ui_parity/loop_runs/.gitkeep +0 -0
- package/sdd/04_verify/10_test/ui_parity/reference/.gitkeep +0 -0
- package/sdd/04_verify/10_test/ui_parity/staged_runs/.gitkeep +0 -0
- package/sdd/04_verify/10_test/verification_harness.md +17 -0
- package/sdd/04_verify/README.md +22 -0
- package/sdd/05_operate/01_runbooks/.gitkeep +1 -0
- package/sdd/05_operate/01_runbooks/README.md +4 -0
- package/sdd/05_operate/02_delivery_status/README.md +4 -0
- package/sdd/05_operate/02_delivery_status/service_status.md +16 -0
- package/sdd/05_operate/README.md +12 -0
- package/sdd/99_toolchain/01_automation/.gitkeep +1 -0
- package/sdd/99_toolchain/01_automation/README.md +76 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/analyze_proof_results.py +132 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/analyze_route_gap.py +85 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/assets/repo-contract.template.json +75 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/bootstrap_frontend_parity.sh +84 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/init_frontend_parity.sh +33 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/init_repo_contract.sh +51 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/repo-contract.json +76 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/resolve_frontend_target.py +52 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/resolve_repo_contract.py +56 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/run_frontend_target.sh +100 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/run_repo_phase.sh +140 -0
- package/sdd/99_toolchain/01_automation/agentic-dev/validate_json_schema.py +39 -0
- package/sdd/99_toolchain/01_automation/agentic-parity-harness-design.md +291 -0
- package/sdd/99_toolchain/01_automation/assets/admin_screen_capture/dashboard.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/admin_screen_capture/login.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/admin_screen_capture/queue.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/admin_screen_capture/support.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/landing_screen_capture/home.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/landing_screen_capture/login.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/landing_screen_capture/workspace.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/mobile_screen_capture/dashboard.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/mobile_screen_capture/fulfillment.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/mobile_screen_capture/login.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/platform_screen_capture/dashboard.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/platform_screen_capture/login.png +0 -0
- package/sdd/99_toolchain/01_automation/assets/platform_screen_capture/orders.png +0 -0
- package/sdd/99_toolchain/01_automation/build_asset_recipes.py +10 -0
- package/sdd/99_toolchain/01_automation/build_screen_spec_pdf.py +427 -0
- package/sdd/99_toolchain/01_automation/capture_screen_assets.mjs +148 -0
- package/sdd/99_toolchain/01_automation/harness-layout.md +34 -0
- package/sdd/99_toolchain/01_automation/parity-execution-tooling-design.md +319 -0
- package/sdd/99_toolchain/01_automation/playwright_exactness_manifest.py +21 -0
- package/sdd/99_toolchain/01_automation/run_playwright_exactness.py +87 -0
- package/sdd/99_toolchain/01_automation/screen_spec_manifest.py +321 -0
- package/sdd/99_toolchain/01_automation/spec_asset_builder.py +274 -0
- package/sdd/99_toolchain/01_automation/ui-contract-projection.md +79 -0
- package/sdd/99_toolchain/01_automation/ui-parity/README.md +60 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/extract-reference-pages.mjs +2 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/materialize-reference-assets.mjs +58 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/normalize-reference-assets.mjs +2 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/route-gap-report.mjs +187 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/run-proof.mjs +50 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/scaffold-contract.mjs +62 -0
- package/sdd/99_toolchain/01_automation/ui-parity/cli/upload-parity1.mjs +2 -0
- package/sdd/99_toolchain/01_automation/ui-parity/contracts/collector-metadata.schema.json +33 -0
- package/sdd/99_toolchain/01_automation/ui-parity/contracts/proof-result.schema.json +76 -0
- package/sdd/99_toolchain/01_automation/ui-parity/contracts/route-gap-report.schema.json +95 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/capture-runner.mjs +55 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/load-adapter.mjs +25 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/load-contract.mjs +81 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/paths.mjs +23 -0
- package/sdd/99_toolchain/01_automation/ui-parity/core/proof-runner.mjs +255 -0
- package/sdd/99_toolchain/01_automation/ui-parity/interfaces/ui-parity-artifact-layout.md +23 -0
- package/sdd/99_toolchain/01_automation/ui-parity/interfaces/ui-parity-proof-interface.md +60 -0
- package/sdd/99_toolchain/01_automation/ui-parity/interfaces/ui-parity-route-gap-interface.md +82 -0
- package/sdd/99_toolchain/01_automation/ui-parity/runtime/playwright-runtime.mjs +16 -0
- package/sdd/99_toolchain/01_automation/ui-parity/runtime/static-runtime.mjs +6 -0
- package/sdd/99_toolchain/02_policies/.gitkeep +1 -0
- package/sdd/99_toolchain/02_policies/build-ast-governance-policy.md +22 -0
- package/sdd/99_toolchain/02_policies/compose-runtime-baseline-policy.md +24 -0
- package/sdd/99_toolchain/02_policies/convention-storage-policy.md +26 -0
- package/sdd/99_toolchain/02_policies/main-push-before-dev-deploy-policy.md +27 -0
- package/sdd/99_toolchain/02_policies/otro-orchestration-policy.md +30 -0
- package/sdd/99_toolchain/02_policies/regression-verification-policy.md +22 -0
- package/sdd/99_toolchain/03_templates/.gitkeep +1 -0
- package/sdd/99_toolchain/03_templates/asset_recipe_manifest.example.py +38 -0
- package/sdd/99_toolchain/03_templates/generated_assets/README.md +11 -0
- package/sdd/99_toolchain/03_templates/generated_assets/example-brand-lockup.svg +3 -0
- package/sdd/99_toolchain/03_templates/generated_assets/example-brand-mark.svg +3 -0
- package/sdd/99_toolchain/03_templates/generated_assets/example-brand-wordmark.svg +3 -0
- package/sdd/99_toolchain/03_templates/playwright_exactness_manifest.example.py +21 -0
- package/sdd/99_toolchain/README.md +23 -0
- package/sdd/README.md +21 -0
- package/server/.dockerignore +4 -0
- package/server/.env.example +19 -0
- package/server/Dockerfile +22 -0
- package/server/Dockerfile.dev +19 -0
- package/server/README.md +33 -0
- package/server/__init__.py +0 -0
- package/server/api/__init__.py +1 -0
- package/server/api/http/__init__.py +4 -0
- package/server/api/http/app.py +53 -0
- package/server/api/http/router.py +24 -0
- package/server/config.py +52 -0
- package/server/contexts/__init__.py +12 -0
- package/server/contexts/alerts/__init__.py +1 -0
- package/server/contexts/alerts/application/__init__.py +13 -0
- package/server/contexts/alerts/application/services.py +41 -0
- package/server/contexts/alerts/contracts/__init__.py +3 -0
- package/server/contexts/alerts/contracts/http/__init__.py +3 -0
- package/server/contexts/alerts/contracts/http/router.py +37 -0
- package/server/contexts/alerts/domain/__init__.py +15 -0
- package/server/contexts/alerts/domain/models.py +29 -0
- package/server/contexts/alerts/infrastructure/__init__.py +11 -0
- package/server/contexts/alerts/infrastructure/repository.py +41 -0
- package/server/contexts/auth/__init__.py +1 -0
- package/server/contexts/auth/application/__init__.py +3 -0
- package/server/contexts/auth/application/ports.py +10 -0
- package/server/contexts/auth/application/services.py +64 -0
- package/server/contexts/auth/contracts/__init__.py +4 -0
- package/server/contexts/auth/contracts/http/__init__.py +4 -0
- package/server/contexts/auth/contracts/http/dependencies.py +37 -0
- package/server/contexts/auth/contracts/http/router.py +19 -0
- package/server/contexts/auth/domain/__init__.py +3 -0
- package/server/contexts/auth/domain/models.py +24 -0
- package/server/contexts/auth/infrastructure/__init__.py +4 -0
- package/server/contexts/auth/infrastructure/adapters/memory.py +19 -0
- package/server/contexts/auth/infrastructure/adapters/mongodb.py +24 -0
- package/server/contexts/auth/infrastructure/adapters/sqlalchemy.py +74 -0
- package/server/contexts/auth/infrastructure/repository.py +28 -0
- package/server/contexts/catalog/__init__.py +1 -0
- package/server/contexts/catalog/application/__init__.py +28 -0
- package/server/contexts/catalog/application/ports.py +15 -0
- package/server/contexts/catalog/application/services.py +154 -0
- package/server/contexts/catalog/contracts/__init__.py +3 -0
- package/server/contexts/catalog/contracts/http/__init__.py +3 -0
- package/server/contexts/catalog/contracts/http/router.py +60 -0
- package/server/contexts/catalog/domain/__init__.py +45 -0
- package/server/contexts/catalog/domain/models.py +113 -0
- package/server/contexts/catalog/infrastructure/__init__.py +4 -0
- package/server/contexts/catalog/infrastructure/adapters/memory.py +62 -0
- package/server/contexts/catalog/infrastructure/repository.py +8 -0
- package/server/contexts/fulfillment/__init__.py +1 -0
- package/server/contexts/fulfillment/application/__init__.py +13 -0
- package/server/contexts/fulfillment/application/ports.py +20 -0
- package/server/contexts/fulfillment/application/services.py +85 -0
- package/server/contexts/fulfillment/contracts/__init__.py +3 -0
- package/server/contexts/fulfillment/contracts/http/__init__.py +3 -0
- package/server/contexts/fulfillment/contracts/http/router.py +40 -0
- package/server/contexts/fulfillment/domain/__init__.py +25 -0
- package/server/contexts/fulfillment/domain/models.py +73 -0
- package/server/contexts/fulfillment/infrastructure/__init__.py +13 -0
- package/server/contexts/fulfillment/infrastructure/adapters/memory.py +43 -0
- package/server/contexts/fulfillment/infrastructure/repository.py +97 -0
- package/server/contexts/health/__init__.py +1 -0
- package/server/contexts/health/application/__init__.py +3 -0
- package/server/contexts/health/application/services.py +2 -0
- package/server/contexts/health/contracts/__init__.py +3 -0
- package/server/contexts/health/contracts/http/__init__.py +3 -0
- package/server/contexts/health/contracts/http/router.py +10 -0
- package/server/contexts/inventory/__init__.py +1 -0
- package/server/contexts/inventory/application/__init__.py +28 -0
- package/server/contexts/inventory/application/ports.py +11 -0
- package/server/contexts/inventory/application/services.py +214 -0
- package/server/contexts/inventory/contracts/__init__.py +3 -0
- package/server/contexts/inventory/contracts/http/__init__.py +3 -0
- package/server/contexts/inventory/contracts/http/router.py +82 -0
- package/server/contexts/inventory/domain/__init__.py +33 -0
- package/server/contexts/inventory/domain/models.py +93 -0
- package/server/contexts/inventory/infrastructure/__init__.py +4 -0
- package/server/contexts/inventory/infrastructure/adapters/memory.py +24 -0
- package/server/contexts/inventory/infrastructure/repository.py +8 -0
- package/server/contexts/orders/__init__.py +1 -0
- package/server/contexts/orders/application/__init__.py +19 -0
- package/server/contexts/orders/application/services.py +127 -0
- package/server/contexts/orders/contracts/__init__.py +3 -0
- package/server/contexts/orders/contracts/http/__init__.py +3 -0
- package/server/contexts/orders/contracts/http/router.py +82 -0
- package/server/contexts/orders/domain/__init__.py +29 -0
- package/server/contexts/orders/domain/models.py +95 -0
- package/server/contexts/orders/infrastructure/__init__.py +7 -0
- package/server/contexts/orders/infrastructure/repository.py +104 -0
- package/server/contexts/shipping/__init__.py +1 -0
- package/server/contexts/shipping/application/__init__.py +13 -0
- package/server/contexts/shipping/application/services.py +92 -0
- package/server/contexts/shipping/contracts/__init__.py +3 -0
- package/server/contexts/shipping/contracts/http/__init__.py +3 -0
- package/server/contexts/shipping/contracts/http/router.py +40 -0
- package/server/contexts/shipping/domain/__init__.py +19 -0
- package/server/contexts/shipping/domain/models.py +48 -0
- package/server/contexts/shipping/infrastructure/__init__.py +9 -0
- package/server/contexts/shipping/infrastructure/repository.py +50 -0
- package/server/contexts/support/__init__.py +1 -0
- package/server/contexts/support/application/__init__.py +13 -0
- package/server/contexts/support/application/services.py +29 -0
- package/server/contexts/support/contracts/__init__.py +3 -0
- package/server/contexts/support/contracts/http/__init__.py +3 -0
- package/server/contexts/support/contracts/http/router.py +40 -0
- package/server/contexts/support/domain/__init__.py +13 -0
- package/server/contexts/support/domain/models.py +27 -0
- package/server/contexts/support/infrastructure/__init__.py +11 -0
- package/server/contexts/support/infrastructure/repository.py +70 -0
- package/server/contexts/user/__init__.py +1 -0
- package/server/contexts/user/application/__init__.py +3 -0
- package/server/contexts/user/application/ports.py +11 -0
- package/server/contexts/user/application/services.py +44 -0
- package/server/contexts/user/contracts/__init__.py +3 -0
- package/server/contexts/user/contracts/http/__init__.py +3 -0
- package/server/contexts/user/contracts/http/router.py +26 -0
- package/server/contexts/user/domain/__init__.py +3 -0
- package/server/contexts/user/domain/models.py +22 -0
- package/server/contexts/user/infrastructure/__init__.py +3 -0
- package/server/contexts/user/infrastructure/adapters/memory.py +27 -0
- package/server/contexts/user/infrastructure/adapters/mongodb.py +41 -0
- package/server/contexts/user/infrastructure/adapters/sqlalchemy.py +94 -0
- package/server/contexts/user/infrastructure/factory.py +28 -0
- package/server/data/README.md +24 -0
- package/server/data/bootstrap/alerts.json +38 -0
- package/server/data/bootstrap/auth_accounts.json +18 -0
- package/server/data/bootstrap/catalog_products.json +179 -0
- package/server/data/bootstrap/fulfillment_events.json +5 -0
- package/server/data/bootstrap/fulfillment_notes.json +5 -0
- package/server/data/bootstrap/fulfillment_tasks.json +50 -0
- package/server/data/bootstrap/inventory_levels.json +80 -0
- package/server/data/bootstrap/orders.json +62 -0
- package/server/data/bootstrap/shipping_shipments.json +50 -0
- package/server/data/bootstrap/support_faqs.json +26 -0
- package/server/data/bootstrap/users.json +20 -0
- package/server/data/bootstrap_loader.py +15 -0
- package/server/docker-entrypoint.sh +56 -0
- package/server/main.py +3 -0
- package/server/pyproject.toml +36 -0
- package/server/shared/__init__.py +1 -0
- package/server/shared/application/__init__.py +3 -0
- package/server/shared/application/health.py +2 -0
- package/server/shared/infrastructure/__init__.py +10 -0
- package/server/shared/infrastructure/runtime.py +6 -0
- package/server/shared/infrastructure/security.py +33 -0
- package/server/tests/e2e/test_domain_feature_flows.py +483 -0
- package/server/tests/test_health.py +49 -0
- package/server/uv.lock +1169 -0
- package/bin/agentic-dev.js +0 -9
- package/src/cli.js +0 -37
- package/src/init-command.js +0 -230
- package/src/lib/command.js +0 -14
- package/src/lib/fs.js +0 -92
- package/src/lib/git.js +0 -57
- package/src/lib/github.js +0 -77
- package/src/lib/prompt.js +0 -52
- package/src/lib/system.js +0 -15
- package/src/lib/template.js +0 -143
package/.agent/prd.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"project": "template-agentic-program",
|
|
3
|
+
"goal": "이 파일은 Ralph loop starter scaffold다. downstream 저장소는 현재 작업 scope에 맞는 story set으로 즉시 교체한다.",
|
|
4
|
+
"updated_at": "2026-03-19T00:00:00+09:00",
|
|
5
|
+
"stories": [
|
|
6
|
+
{
|
|
7
|
+
"id": "TEMPLATE-ALIGN-001",
|
|
8
|
+
"title": "Replace template PRD scaffold with repository-specific delivery stories",
|
|
9
|
+
"priority": 1,
|
|
10
|
+
"status": "pending",
|
|
11
|
+
"scope": [
|
|
12
|
+
".agent/prd.json",
|
|
13
|
+
".agent/prompt.md",
|
|
14
|
+
"sdd/02_plan",
|
|
15
|
+
"sdd/03_build",
|
|
16
|
+
"sdd/04_verify"
|
|
17
|
+
],
|
|
18
|
+
"validation": [
|
|
19
|
+
"jq . .agent/prd.json"
|
|
20
|
+
],
|
|
21
|
+
"done_when": [
|
|
22
|
+
"Template placeholder stories are replaced with repository-specific work items.",
|
|
23
|
+
"Validation commands point at the active repository program.",
|
|
24
|
+
"progress.txt contains the current operator note."
|
|
25
|
+
],
|
|
26
|
+
"blockers": []
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2026-03-19 scaffold initialized for canonical template Ralph loop.
|
package/.agent/prompt.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
You are running one Ralph iteration in this repository.
|
|
2
|
+
|
|
3
|
+
Rules:
|
|
4
|
+
1. Read `.agent/prd.json` and `.agent/progress.txt`.
|
|
5
|
+
2. Work only on the requested story id.
|
|
6
|
+
3. Lock one reproduction or validation command before editing.
|
|
7
|
+
4. Make one focused change set toward the requested story.
|
|
8
|
+
5. Re-run the requested validation commands immediately.
|
|
9
|
+
6. Update the matching `sdd/02_plan`, `sdd/03_build`, and `sdd/04_verify` current-state artifacts when scope changes.
|
|
10
|
+
7. Update `.agent/prd.json` story status and append one short line to `.agent/progress.txt`.
|
|
11
|
+
8. Stop after this iteration and report:
|
|
12
|
+
- story id
|
|
13
|
+
- validation status
|
|
14
|
+
- files changed
|
|
15
|
+
- next story or blocker
|
|
16
|
+
9. If the caller provided a completion promise token and the story is truly complete in this iteration, print that token exactly once.
|
|
17
|
+
|
|
18
|
+
Guardrails:
|
|
19
|
+
- Do not create a parallel `docs/` tree when `sdd/` exists.
|
|
20
|
+
- Do not leave execution-history narrative inside `sdd/03_build`.
|
|
21
|
+
- Do not claim completion without validation evidence.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"updated_at": "2026-03-19T00:00:00Z",
|
|
3
|
+
"story_id": "",
|
|
4
|
+
"max_iterations": 12,
|
|
5
|
+
"current_iteration": 0,
|
|
6
|
+
"status": "idle",
|
|
7
|
+
"completion_promise": "STORY_COMPLETE",
|
|
8
|
+
"promise_seen": false,
|
|
9
|
+
"last_exit_code": 0,
|
|
10
|
+
"prompt_snapshot": "",
|
|
11
|
+
"output_file": "",
|
|
12
|
+
"changed_files": []
|
|
13
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
6
|
+
AGENT_DIR="$ROOT_DIR/.agent"
|
|
7
|
+
PRD_FILE="$AGENT_DIR/prd.json"
|
|
8
|
+
PROGRESS_FILE="$AGENT_DIR/progress.txt"
|
|
9
|
+
RUNS_DIR="$AGENT_DIR/runs"
|
|
10
|
+
STATE_FILE="$AGENT_DIR/ralph-supervisor-state.json"
|
|
11
|
+
RALPH_RUNNER="$AGENT_DIR/ralph.sh"
|
|
12
|
+
|
|
13
|
+
max_iterations=1000
|
|
14
|
+
story_iterations=1
|
|
15
|
+
completion_promise="STORY_COMPLETE"
|
|
16
|
+
run_label=""
|
|
17
|
+
sleep_seconds=0
|
|
18
|
+
dry_run=0
|
|
19
|
+
|
|
20
|
+
usage() {
|
|
21
|
+
cat <<'EOF'
|
|
22
|
+
Usage:
|
|
23
|
+
.agent/ralph-supervisor.sh [options]
|
|
24
|
+
|
|
25
|
+
Options:
|
|
26
|
+
--max-iterations N Maximum global iterations across all stories. Default: 1000
|
|
27
|
+
--story-iterations N Iterations per selected story invocation. Default: 1
|
|
28
|
+
--completion-promise TXT Promise token passed to child Ralph runner
|
|
29
|
+
--run-label LABEL Optional label suffix for this supervisor run
|
|
30
|
+
--sleep-seconds N Sleep between global iterations
|
|
31
|
+
--dry-run Use child runner in dry-run mode
|
|
32
|
+
-h, --help Show help
|
|
33
|
+
|
|
34
|
+
Behavior:
|
|
35
|
+
- Picks the next pending/in_progress story from .agent/prd.json each global iteration
|
|
36
|
+
- Invokes .agent/ralph.sh for one focused child loop
|
|
37
|
+
- Stops when all stories complete, when max iterations are exhausted,
|
|
38
|
+
or when the same story/status pair repeats 3 times with no new signal
|
|
39
|
+
- Writes state to .agent/ralph-supervisor-state.json and appends monitor lines to .agent/progress.txt
|
|
40
|
+
EOF
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
require_file() {
|
|
44
|
+
local file_path="$1"
|
|
45
|
+
if [[ ! -f "$file_path" ]]; then
|
|
46
|
+
echo "Missing required file: $file_path" >&2
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
select_story() {
|
|
52
|
+
jq -r '
|
|
53
|
+
.stories
|
|
54
|
+
| map(select(.status == "in_progress" or .status == "pending"))
|
|
55
|
+
| sort_by(.priority)
|
|
56
|
+
| .[0].id // empty
|
|
57
|
+
' "$PRD_FILE"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
read_story_status() {
|
|
61
|
+
local story_id="$1"
|
|
62
|
+
jq -r --arg id "$story_id" '.stories[] | select(.id == $id) | .status // "missing"' "$PRD_FILE"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
write_state() {
|
|
66
|
+
local iteration="$1"
|
|
67
|
+
local active_story="$2"
|
|
68
|
+
local child_exit="$3"
|
|
69
|
+
local child_status="$4"
|
|
70
|
+
local repeat_count="$5"
|
|
71
|
+
local status="$6"
|
|
72
|
+
local run_dir="$7"
|
|
73
|
+
|
|
74
|
+
cat >"$STATE_FILE" <<EOF
|
|
75
|
+
{
|
|
76
|
+
"updated_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
|
|
77
|
+
"max_iterations": $max_iterations,
|
|
78
|
+
"story_iterations": $story_iterations,
|
|
79
|
+
"current_iteration": $iteration,
|
|
80
|
+
"active_story": "$active_story",
|
|
81
|
+
"child_exit_code": $child_exit,
|
|
82
|
+
"child_status": "$child_status",
|
|
83
|
+
"repeat_count": $repeat_count,
|
|
84
|
+
"status": "$status",
|
|
85
|
+
"run_dir": "${run_dir#$ROOT_DIR/}"
|
|
86
|
+
}
|
|
87
|
+
EOF
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
main() {
|
|
91
|
+
require_file "$PRD_FILE"
|
|
92
|
+
require_file "$PROGRESS_FILE"
|
|
93
|
+
require_file "$RALPH_RUNNER"
|
|
94
|
+
|
|
95
|
+
while [[ $# -gt 0 ]]; do
|
|
96
|
+
case "$1" in
|
|
97
|
+
--max-iterations)
|
|
98
|
+
max_iterations="${2:-}"
|
|
99
|
+
shift 2
|
|
100
|
+
;;
|
|
101
|
+
--story-iterations)
|
|
102
|
+
story_iterations="${2:-}"
|
|
103
|
+
shift 2
|
|
104
|
+
;;
|
|
105
|
+
--completion-promise)
|
|
106
|
+
completion_promise="${2:-}"
|
|
107
|
+
shift 2
|
|
108
|
+
;;
|
|
109
|
+
--run-label)
|
|
110
|
+
run_label="${2:-}"
|
|
111
|
+
shift 2
|
|
112
|
+
;;
|
|
113
|
+
--sleep-seconds)
|
|
114
|
+
sleep_seconds="${2:-}"
|
|
115
|
+
shift 2
|
|
116
|
+
;;
|
|
117
|
+
--dry-run)
|
|
118
|
+
dry_run=1
|
|
119
|
+
shift
|
|
120
|
+
;;
|
|
121
|
+
-h|--help)
|
|
122
|
+
usage
|
|
123
|
+
exit 0
|
|
124
|
+
;;
|
|
125
|
+
*)
|
|
126
|
+
echo "Unknown argument: $1" >&2
|
|
127
|
+
usage >&2
|
|
128
|
+
exit 2
|
|
129
|
+
;;
|
|
130
|
+
esac
|
|
131
|
+
done
|
|
132
|
+
|
|
133
|
+
if ! [[ "$max_iterations" =~ ^[0-9]+$ ]] || [[ "$max_iterations" -lt 1 ]]; then
|
|
134
|
+
echo "--max-iterations must be a positive integer" >&2
|
|
135
|
+
exit 2
|
|
136
|
+
fi
|
|
137
|
+
if ! [[ "$story_iterations" =~ ^[0-9]+$ ]] || [[ "$story_iterations" -lt 1 ]]; then
|
|
138
|
+
echo "--story-iterations must be a positive integer" >&2
|
|
139
|
+
exit 2
|
|
140
|
+
fi
|
|
141
|
+
if ! [[ "$sleep_seconds" =~ ^[0-9]+$ ]] || [[ "$sleep_seconds" -lt 0 ]]; then
|
|
142
|
+
echo "--sleep-seconds must be a non-negative integer" >&2
|
|
143
|
+
exit 2
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
mkdir -p "$RUNS_DIR"
|
|
147
|
+
local run_id
|
|
148
|
+
run_id="$(date +%Y%m%d-%H%M%S)"
|
|
149
|
+
if [[ -n "$run_label" ]]; then
|
|
150
|
+
run_id="$run_id-$run_label"
|
|
151
|
+
fi
|
|
152
|
+
local supervisor_run_dir="$RUNS_DIR/supervisor-$run_id"
|
|
153
|
+
mkdir -p "$supervisor_run_dir"
|
|
154
|
+
|
|
155
|
+
local previous_signature=""
|
|
156
|
+
local repeat_count=0
|
|
157
|
+
local final_status="max_iterations_reached"
|
|
158
|
+
|
|
159
|
+
local iteration=1
|
|
160
|
+
while [[ "$iteration" -le "$max_iterations" ]]; do
|
|
161
|
+
local story_id
|
|
162
|
+
story_id="$(select_story)"
|
|
163
|
+
if [[ -z "$story_id" ]]; then
|
|
164
|
+
final_status="all_stories_completed"
|
|
165
|
+
write_state "$iteration" "" 0 "none" 0 "$final_status" "$supervisor_run_dir"
|
|
166
|
+
echo "$(date +%F) supervisor all-stories-complete iteration=$iteration" >>"$PROGRESS_FILE"
|
|
167
|
+
break
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
echo "[supervisor] iteration $iteration/$max_iterations story=$story_id"
|
|
171
|
+
|
|
172
|
+
local child_args=(
|
|
173
|
+
--story-id "$story_id"
|
|
174
|
+
--max-iterations "$story_iterations"
|
|
175
|
+
--completion-promise "$completion_promise"
|
|
176
|
+
--run-label "supervisor-$iteration-$story_id"
|
|
177
|
+
)
|
|
178
|
+
if [[ $dry_run -eq 1 ]]; then
|
|
179
|
+
child_args+=(--dry-run)
|
|
180
|
+
fi
|
|
181
|
+
|
|
182
|
+
set +e
|
|
183
|
+
"$RALPH_RUNNER" "${child_args[@]}"
|
|
184
|
+
local child_exit=$?
|
|
185
|
+
set -e
|
|
186
|
+
|
|
187
|
+
local child_status="unknown"
|
|
188
|
+
if [[ -f "$AGENT_DIR/ralph-loop-state.json" ]]; then
|
|
189
|
+
child_status="$(jq -r '.status // "unknown"' "$AGENT_DIR/ralph-loop-state.json")"
|
|
190
|
+
fi
|
|
191
|
+
|
|
192
|
+
local story_status
|
|
193
|
+
story_status="$(read_story_status "$story_id")"
|
|
194
|
+
local signature="$story_id:$child_status:$story_status"
|
|
195
|
+
if [[ "$signature" == "$previous_signature" ]]; then
|
|
196
|
+
repeat_count=$((repeat_count + 1))
|
|
197
|
+
else
|
|
198
|
+
repeat_count=1
|
|
199
|
+
previous_signature="$signature"
|
|
200
|
+
fi
|
|
201
|
+
|
|
202
|
+
if [[ "$story_status" == "completed" || "$child_status" == "completed" ]]; then
|
|
203
|
+
final_status="story_completed"
|
|
204
|
+
elif [[ "$repeat_count" -ge 3 ]]; then
|
|
205
|
+
final_status="stopped_same_signal_3x"
|
|
206
|
+
elif [[ "$child_status" == "iteration_pass_no_promise" || "$child_status" == "dry_run" || "$child_exit" -eq 0 ]]; then
|
|
207
|
+
final_status="iteration_ok"
|
|
208
|
+
else
|
|
209
|
+
final_status="iteration_failed"
|
|
210
|
+
fi
|
|
211
|
+
|
|
212
|
+
write_state "$iteration" "$story_id" "$child_exit" "$child_status" "$repeat_count" "$final_status" "$supervisor_run_dir"
|
|
213
|
+
echo "$(date +%F) supervisor iteration-$iteration story=$story_id child_status=$child_status story_status=$story_status repeat=$repeat_count exit=$child_exit" >>"$PROGRESS_FILE"
|
|
214
|
+
|
|
215
|
+
if [[ "$final_status" == "stopped_same_signal_3x" ]]; then
|
|
216
|
+
break
|
|
217
|
+
fi
|
|
218
|
+
|
|
219
|
+
iteration=$((iteration + 1))
|
|
220
|
+
if [[ "$iteration" -le "$max_iterations" && "$sleep_seconds" -gt 0 ]]; then
|
|
221
|
+
sleep "$sleep_seconds"
|
|
222
|
+
fi
|
|
223
|
+
done
|
|
224
|
+
|
|
225
|
+
echo "[supervisor] final_status=$final_status run_dir=${supervisor_run_dir#$ROOT_DIR/}"
|
|
226
|
+
if [[ "$final_status" == "all_stories_completed" ]]; then
|
|
227
|
+
exit 0
|
|
228
|
+
fi
|
|
229
|
+
if [[ "$final_status" == "stopped_same_signal_3x" ]]; then
|
|
230
|
+
exit 1
|
|
231
|
+
fi
|
|
232
|
+
if [[ "$final_status" == "max_iterations_reached" ]]; then
|
|
233
|
+
exit 1
|
|
234
|
+
fi
|
|
235
|
+
exit 0
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
main "$@"
|
package/.agent/ralph.sh
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
6
|
+
AGENT_DIR="$ROOT_DIR/.agent"
|
|
7
|
+
PRD_FILE="$AGENT_DIR/prd.json"
|
|
8
|
+
PROMPT_FILE="$AGENT_DIR/prompt.md"
|
|
9
|
+
PROGRESS_FILE="$AGENT_DIR/progress.txt"
|
|
10
|
+
RUNS_DIR="$AGENT_DIR/runs"
|
|
11
|
+
STATE_FILE="$AGENT_DIR/ralph-loop-state.json"
|
|
12
|
+
|
|
13
|
+
story_id=""
|
|
14
|
+
max_iterations=12
|
|
15
|
+
completion_promise="STORY_COMPLETE"
|
|
16
|
+
prompt_file="$PROMPT_FILE"
|
|
17
|
+
run_label=""
|
|
18
|
+
sleep_seconds=0
|
|
19
|
+
dry_run=0
|
|
20
|
+
|
|
21
|
+
usage() {
|
|
22
|
+
cat <<'EOF'
|
|
23
|
+
Usage:
|
|
24
|
+
.agent/ralph.sh [story_id]
|
|
25
|
+
.agent/ralph.sh --story-id MOB-EXACT-AUTH-001 --max-iterations 20
|
|
26
|
+
|
|
27
|
+
Options:
|
|
28
|
+
--story-id ID Ralph story id from .agent/prd.json
|
|
29
|
+
--max-iterations N Maximum codex iterations to run
|
|
30
|
+
--completion-promise TXT Promise token to detect in codex output
|
|
31
|
+
--prompt-file PATH Base prompt markdown file
|
|
32
|
+
--run-label LABEL Optional run label for the log directory
|
|
33
|
+
--sleep-seconds N Sleep between iterations
|
|
34
|
+
--dry-run Do not invoke codex exec; only emit prompt snapshots
|
|
35
|
+
-h, --help Show help
|
|
36
|
+
|
|
37
|
+
Behavior:
|
|
38
|
+
- Select the first in_progress/pending story when no story id is given
|
|
39
|
+
- Run codex exec in a loop until the completion promise is observed
|
|
40
|
+
- Persist per-iteration prompt/output/status artifacts under .agent/runs/
|
|
41
|
+
- Append monitor lines to .agent/progress.txt
|
|
42
|
+
EOF
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
require_file() {
|
|
46
|
+
local file_path="$1"
|
|
47
|
+
if [[ ! -f "$file_path" ]]; then
|
|
48
|
+
echo "Missing required file: $file_path" >&2
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
select_story() {
|
|
54
|
+
if [[ -n "$story_id" ]]; then
|
|
55
|
+
return 0
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
story_id="$(
|
|
59
|
+
jq -r '
|
|
60
|
+
.stories
|
|
61
|
+
| map(select(.status == "in_progress" or .status == "pending"))
|
|
62
|
+
| sort_by(.priority)
|
|
63
|
+
| .[0].id // empty
|
|
64
|
+
' "$PRD_FILE"
|
|
65
|
+
)"
|
|
66
|
+
|
|
67
|
+
if [[ -z "$story_id" ]]; then
|
|
68
|
+
echo "No open Ralph story found." >&2
|
|
69
|
+
exit 1
|
|
70
|
+
fi
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
load_story_payload() {
|
|
74
|
+
jq -c --arg id "$story_id" '.stories[] | select(.id == $id)' "$PRD_FILE"
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
write_state() {
|
|
78
|
+
local iteration="$1"
|
|
79
|
+
local status="$2"
|
|
80
|
+
local promise_seen="$3"
|
|
81
|
+
local output_file="$4"
|
|
82
|
+
local prompt_snapshot="$5"
|
|
83
|
+
local exit_code="$6"
|
|
84
|
+
local changed_files_json="$7"
|
|
85
|
+
|
|
86
|
+
cat >"$STATE_FILE" <<EOF
|
|
87
|
+
{
|
|
88
|
+
"updated_at": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
|
|
89
|
+
"story_id": "$story_id",
|
|
90
|
+
"max_iterations": $max_iterations,
|
|
91
|
+
"current_iteration": $iteration,
|
|
92
|
+
"status": "$status",
|
|
93
|
+
"completion_promise": "$completion_promise",
|
|
94
|
+
"promise_seen": $promise_seen,
|
|
95
|
+
"last_exit_code": $exit_code,
|
|
96
|
+
"prompt_snapshot": "${prompt_snapshot#$ROOT_DIR/}",
|
|
97
|
+
"output_file": "${output_file#$ROOT_DIR/}",
|
|
98
|
+
"changed_files": $changed_files_json
|
|
99
|
+
}
|
|
100
|
+
EOF
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
snapshot_prompt() {
|
|
104
|
+
local destination="$1"
|
|
105
|
+
local story_payload="$2"
|
|
106
|
+
local iteration="$3"
|
|
107
|
+
|
|
108
|
+
cat "$prompt_file" >"$destination"
|
|
109
|
+
cat >>"$destination" <<EOF
|
|
110
|
+
|
|
111
|
+
Loop control:
|
|
112
|
+
- You are executing one iteration of a persistent Ralph loop runner.
|
|
113
|
+
- Current iteration: $iteration / $max_iterations
|
|
114
|
+
- Story id: $story_id
|
|
115
|
+
- Completion promise token: <promise>$completion_promise</promise>
|
|
116
|
+
- If and only if the requested story is actually complete and all validations pass in this iteration, print exactly:
|
|
117
|
+
<promise>$completion_promise</promise>
|
|
118
|
+
- If the story is not complete, do not print the promise token.
|
|
119
|
+
|
|
120
|
+
Current story payload:
|
|
121
|
+
$(printf '%s\n' "$story_payload" | jq .)
|
|
122
|
+
EOF
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
append_progress_monitor_line() {
|
|
126
|
+
local iteration="$1"
|
|
127
|
+
local status="$2"
|
|
128
|
+
local promise_seen="$3"
|
|
129
|
+
local exit_code="$4"
|
|
130
|
+
echo "$(date +%F) monitor iteration-$iteration story=$story_id status=$status promise=$promise_seen exit=$exit_code" >>"$PROGRESS_FILE"
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
main() {
|
|
134
|
+
require_file "$PRD_FILE"
|
|
135
|
+
require_file "$prompt_file"
|
|
136
|
+
require_file "$PROGRESS_FILE"
|
|
137
|
+
|
|
138
|
+
if [[ $# -gt 0 && "${1:-}" != --* ]]; then
|
|
139
|
+
story_id="$1"
|
|
140
|
+
shift
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
while [[ $# -gt 0 ]]; do
|
|
144
|
+
case "$1" in
|
|
145
|
+
--story-id)
|
|
146
|
+
story_id="${2:-}"
|
|
147
|
+
shift 2
|
|
148
|
+
;;
|
|
149
|
+
--max-iterations)
|
|
150
|
+
max_iterations="${2:-}"
|
|
151
|
+
shift 2
|
|
152
|
+
;;
|
|
153
|
+
--completion-promise)
|
|
154
|
+
completion_promise="${2:-}"
|
|
155
|
+
shift 2
|
|
156
|
+
;;
|
|
157
|
+
--prompt-file)
|
|
158
|
+
prompt_file="${2:-}"
|
|
159
|
+
shift 2
|
|
160
|
+
;;
|
|
161
|
+
--run-label)
|
|
162
|
+
run_label="${2:-}"
|
|
163
|
+
shift 2
|
|
164
|
+
;;
|
|
165
|
+
--sleep-seconds)
|
|
166
|
+
sleep_seconds="${2:-}"
|
|
167
|
+
shift 2
|
|
168
|
+
;;
|
|
169
|
+
--dry-run)
|
|
170
|
+
dry_run=1
|
|
171
|
+
shift
|
|
172
|
+
;;
|
|
173
|
+
-h|--help)
|
|
174
|
+
usage
|
|
175
|
+
exit 0
|
|
176
|
+
;;
|
|
177
|
+
*)
|
|
178
|
+
echo "Unknown argument: $1" >&2
|
|
179
|
+
usage >&2
|
|
180
|
+
exit 2
|
|
181
|
+
;;
|
|
182
|
+
esac
|
|
183
|
+
done
|
|
184
|
+
|
|
185
|
+
if ! [[ "$max_iterations" =~ ^[0-9]+$ ]] || [[ "$max_iterations" -lt 1 ]]; then
|
|
186
|
+
echo "--max-iterations must be a positive integer" >&2
|
|
187
|
+
exit 2
|
|
188
|
+
fi
|
|
189
|
+
|
|
190
|
+
if ! [[ "$sleep_seconds" =~ ^[0-9]+$ ]] || [[ "$sleep_seconds" -lt 0 ]]; then
|
|
191
|
+
echo "--sleep-seconds must be a non-negative integer" >&2
|
|
192
|
+
exit 2
|
|
193
|
+
fi
|
|
194
|
+
|
|
195
|
+
select_story
|
|
196
|
+
|
|
197
|
+
local story_payload
|
|
198
|
+
story_payload="$(load_story_payload)"
|
|
199
|
+
if [[ -z "$story_payload" ]]; then
|
|
200
|
+
echo "Story not found: $story_id" >&2
|
|
201
|
+
exit 1
|
|
202
|
+
fi
|
|
203
|
+
|
|
204
|
+
if [[ $dry_run -eq 0 ]] && ! command -v codex >/dev/null 2>&1; then
|
|
205
|
+
echo "codex command not found in PATH" >&2
|
|
206
|
+
exit 1
|
|
207
|
+
fi
|
|
208
|
+
|
|
209
|
+
mkdir -p "$RUNS_DIR"
|
|
210
|
+
local run_id
|
|
211
|
+
run_id="$(date +%Y%m%d-%H%M%S)"
|
|
212
|
+
if [[ -n "$run_label" ]]; then
|
|
213
|
+
run_id="$run_id-$run_label"
|
|
214
|
+
fi
|
|
215
|
+
local run_dir="$RUNS_DIR/$run_id-$story_id"
|
|
216
|
+
mkdir -p "$run_dir"
|
|
217
|
+
|
|
218
|
+
local iteration=1
|
|
219
|
+
local final_status="max_iterations_reached"
|
|
220
|
+
local promise_seen=false
|
|
221
|
+
|
|
222
|
+
while [[ "$iteration" -le "$max_iterations" ]]; do
|
|
223
|
+
story_payload="$(load_story_payload)"
|
|
224
|
+
if [[ -z "$story_payload" ]]; then
|
|
225
|
+
echo "Story disappeared from PRD: $story_id" >&2
|
|
226
|
+
final_status="story_missing"
|
|
227
|
+
break
|
|
228
|
+
fi
|
|
229
|
+
|
|
230
|
+
local prompt_snapshot="$run_dir/iteration-$iteration.prompt.md"
|
|
231
|
+
local output_file="$run_dir/iteration-$iteration.output.log"
|
|
232
|
+
local changed_files_file="$run_dir/iteration-$iteration.changed-files.txt"
|
|
233
|
+
local status_file="$run_dir/iteration-$iteration.status.json"
|
|
234
|
+
|
|
235
|
+
snapshot_prompt "$prompt_snapshot" "$story_payload" "$iteration"
|
|
236
|
+
|
|
237
|
+
echo "[ralph] iteration $iteration/$max_iterations story=$story_id"
|
|
238
|
+
echo "[ralph] prompt: ${prompt_snapshot#$ROOT_DIR/}"
|
|
239
|
+
|
|
240
|
+
local exit_code=0
|
|
241
|
+
if [[ $dry_run -eq 1 ]]; then
|
|
242
|
+
printf '[ralph] dry-run: codex exec skipped\n' | tee "$output_file" >/dev/null
|
|
243
|
+
final_status="dry_run"
|
|
244
|
+
else
|
|
245
|
+
set +e
|
|
246
|
+
codex exec -s danger-full-access -C "$ROOT_DIR" - <"$prompt_snapshot" | tee "$output_file"
|
|
247
|
+
exit_code=${PIPESTATUS[0]}
|
|
248
|
+
set -e
|
|
249
|
+
fi
|
|
250
|
+
|
|
251
|
+
git status --short >"$changed_files_file"
|
|
252
|
+
local changed_files_json
|
|
253
|
+
changed_files_json="$(
|
|
254
|
+
jq -R -s '
|
|
255
|
+
split("\n")
|
|
256
|
+
| map(select(length > 0))
|
|
257
|
+
' "$changed_files_file"
|
|
258
|
+
)"
|
|
259
|
+
|
|
260
|
+
if rg -q "<promise>${completion_promise}</promise>" "$output_file"; then
|
|
261
|
+
promise_seen=true
|
|
262
|
+
final_status="completed"
|
|
263
|
+
elif [[ "$exit_code" -eq 0 ]]; then
|
|
264
|
+
final_status="iteration_pass_no_promise"
|
|
265
|
+
else
|
|
266
|
+
final_status="iteration_failed"
|
|
267
|
+
fi
|
|
268
|
+
|
|
269
|
+
write_state "$iteration" "$final_status" "$promise_seen" "$output_file" "$prompt_snapshot" "$exit_code" "$changed_files_json"
|
|
270
|
+
cat >"$status_file" <<EOF
|
|
271
|
+
{
|
|
272
|
+
"iteration": $iteration,
|
|
273
|
+
"story_id": "$story_id",
|
|
274
|
+
"exit_code": $exit_code,
|
|
275
|
+
"status": "$final_status",
|
|
276
|
+
"promise_seen": $promise_seen,
|
|
277
|
+
"output_file": "${output_file#$ROOT_DIR/}",
|
|
278
|
+
"changed_files_file": "${changed_files_file#$ROOT_DIR/}"
|
|
279
|
+
}
|
|
280
|
+
EOF
|
|
281
|
+
append_progress_monitor_line "$iteration" "$final_status" "$promise_seen" "$exit_code"
|
|
282
|
+
|
|
283
|
+
echo "[ralph] status=$final_status exit=$exit_code promise=$promise_seen"
|
|
284
|
+
echo "[ralph] changed-files: ${changed_files_file#$ROOT_DIR/}"
|
|
285
|
+
|
|
286
|
+
if [[ "$promise_seen" == "true" ]]; then
|
|
287
|
+
break
|
|
288
|
+
fi
|
|
289
|
+
|
|
290
|
+
iteration=$((iteration + 1))
|
|
291
|
+
if [[ "$iteration" -le "$max_iterations" && "$sleep_seconds" -gt 0 ]]; then
|
|
292
|
+
sleep "$sleep_seconds"
|
|
293
|
+
fi
|
|
294
|
+
done
|
|
295
|
+
|
|
296
|
+
echo "[ralph] final_status=$final_status story=$story_id run_dir=${run_dir#$ROOT_DIR/}"
|
|
297
|
+
|
|
298
|
+
if [[ "$final_status" == "completed" || "$final_status" == "dry_run" ]]; then
|
|
299
|
+
exit 0
|
|
300
|
+
fi
|
|
301
|
+
|
|
302
|
+
exit 1
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
main "$@"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
## What This Is
|
|
4
|
+
|
|
5
|
+
범용 웹 제품 템플릿에서 Claude/Codex 실행 규칙과 자동화 하네스 위치를 설명하는 문서다.
|
|
6
|
+
|
|
7
|
+
## Environment Naming Policy
|
|
8
|
+
|
|
9
|
+
- 문서/대화/로그에서 실행 환경은 항상 `DEV(개발계)`로 표기한다.
|
|
10
|
+
- `local`, `localhost 환경` 같은 표현은 운영 용어로 사용하지 않는다.
|
|
11
|
+
|
|
12
|
+
## Harness Layout
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
templates/
|
|
16
|
+
├── .agent/ # Ralph loop harness, PRD scaffold, run state
|
|
17
|
+
├── .claude/ # Claude 설정
|
|
18
|
+
│ ├── agents/ # Claude role agents
|
|
19
|
+
│ └── skills/ # Claude Code repo-local skills (.claude/skills/<name>/SKILL.md)
|
|
20
|
+
├── .codex/ # Codex 설정, 에이전트, 스킬
|
|
21
|
+
├── client/
|
|
22
|
+
│ ├── platform/ # 일반 앱 템플릿
|
|
23
|
+
│ ├── admin/ # 어드민 템플릿
|
|
24
|
+
│ ├── mobile/ # 현장형 모바일 템플릿
|
|
25
|
+
│ └── landing/ # 랜딩 템플릿
|
|
26
|
+
├── server/ # HTTP 서버 템플릿
|
|
27
|
+
└── sdd/ # toolchain 정책/자동화 문서
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Working Rules
|
|
31
|
+
|
|
32
|
+
- 컨벤션과 실행 규칙의 정본은 `sdd/99_toolchain/02_policies`에 둔다.
|
|
33
|
+
- DEV 반영이 필요한 작업은 항상 `main push -> DEV 배포 -> DEV 검증` 순서를 따른다.
|
|
34
|
+
- 템플릿은 특정 서비스/도메인/실환경에 종속된 문자열, URL, 자격증명, 브라우저 상태를 포함하지 않는다.
|
|
35
|
+
- 브라우저 자동화 예시는 generic 흐름만 제공하고, 실제 실행 산출물이나 프로필 데이터는 저장하지 않는다.
|
|
36
|
+
- `sdd/03_build`는 runtime assembly를 설명하는 current-state 문서이며 dated execution narrative를 남기지 않는다.
|
|
37
|
+
- AST-style build current-state 적합성은 `scripts/dev/audit_sdd_build_ast.py`로 검증한다.
|
|
38
|
+
|
|
39
|
+
## Claude Skills
|
|
40
|
+
|
|
41
|
+
- Claude Code 최신 project skill 표면은 `.claude/skills/<name>/SKILL.md`다.
|
|
42
|
+
- Claude Code의 custom commands와 skills는 merge된 표면으로 취급한다. 이 템플릿은 공식 skills 디렉터리 구조를 기본값으로 쓴다.
|
|
43
|
+
- Codex와 Claude가 같은 실행 하네스를 공유해야 할 때는 `.codex/skills/*`의 정본 스크립트와 계약을 재사용하고, Claude skill은 그 진입 규칙과 운영 가이드를 얇게 감싼다.
|
|
44
|
+
- 기본 제공 표면은 `otro`, `planning-with-files`, `ralph-loop`, `commit`, `dev-browser`, `prd`, `sdd`, `sdd-development`다.
|