refactor(structure): promote app to repo root + remove redundant workspace cruft

Standard production layout: the OKR app (was nested under AINative_OKR_CASAN5/) is now
the repository root. No more wrapper directory.

- Promote AINative_OKR_CASAN5/* -> repo root (backend/ frontend/ packages/ apps/
  .specify/ docs/ infra/ nginx/ scripts/ + configs). Merge tool dirs: .gitea (kept the
  active deploy ci.yml, added harness-ci.yml + runbooks), .claude (agents/commands +
  launch.json), .github moved up.
- Remove redundant: 00_SUBMISSION_PACKAGE, scattered root notes (FPT_CASAN_Full.md,
  tu-tuong-casan.md, casan-tu-sinh..., casan_harness_assessment.md, source-review...,
  README_CASAN5_REFINED.md), casan-next-plans/ and optimize-docs/ (competition/planning
  artifacts — roadmap + design history preserved in git log / commit messages).
- Update all references to the old layout:
  - .gitea/workflows/{ci,harness-ci}.yml, .github/workflows/{ci,deploy}.yml:
    working-directory .; drop AINative_OKR_CASAN5/ prefix; .specify/{tests,scripts}
    -> packages/casan-harness/... (.specify/logs state kept)
  - .claude/launch.json, .gitea/*-runbook.md: path prefixes
  - CLAUDE.md, README.md: docs/input -> apps/okr/domain/input
  - policy-bundle.yaml: 8 policy paths -> packages/casan-harness/...; manifest re-signed
- secrets-scan.sh: fixture excludes -> new package/domain paths.

Full gate from the new root: PASS=64 FAIL=0 SKIP=3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
thanhnv
2026-07-08 13:26:36 +09:00
co-authored by Claude Opus 4.8
parent 7101af9fd4
commit 36a4812ef3
925 changed files with 410 additions and 18001 deletions
@@ -0,0 +1,67 @@
# Pipeline Completion Report Template
Use this template when all steps complete (with or without escalations).
```markdown
## ✅ Pipeline Complete (Autonomous Mode) — <feature-name>
**Feature Branch**: <branch>
**Date Completed**: <YYYY-MM-DD>
**Mode**: Built-in Autonomous (no human pauses)
| # | Step | Agent | Model | Status | Retries | Assumptions |
|---|------|-------|-------|--------|---------|-------------|
| 1 | SRS Generation | okr.srs | gpt-5.4 | ✅ | 0 | N |
| 2 | BD Generation (External Design) | okr.bd | gpt-5.4 | ✅ | 0 | N |
| 3 | Spec Creation | speckit.specify | gpt-5.4 | ✅ | 0 | N |
| 4 | Spec Clarification | speckit.clarify | gpt-5.4 | ✅ | 0 | N |
| 5 | Thorough Spec Review | okr.reviewspec | claude-sonnet-4-6 | ✅ | R | - |
| 6 | Implementation Planning | speckit.plan | gpt-5-3-codex | ✅ | 0 | N |
| 7 | Plan Conformance Review | okr.reviewplan | claude-sonnet-4-6 | ✅ | R | - |
| 8 | DD Generation (Internal Design) | okr.dd | gpt-5-3-codex | ✅ | 0 | N |
| 8b | Test Case Generation | okr.testkit | claude-sonnet-4-6 | ✅ | 0 | N |
| 9 | Task Generation | speckit.tasks | gpt-5.4 | ✅ | 0 | N |
| 10 | Implementation + Build & Fix | speckit.implement | gpt-5-3-codex | ✅ | R | N |
| 11 | Code Review | okr.reviewcode | claude-sonnet-4-6 | ✅ | R | - |
| 12 | Final QA Audit | okr.testkit | claude-sonnet-4-6 | ✅ | R | - |
| 13 | Launch | Boss (direct) | claude-sonnet-4-6 | ✅ | R | - |
**Total auto-resolved assumptions:** N (High: X, Med: Y, Low: Z)
**Total gate retries:** N
**Escalated gates:** <list or "None">
> ⚠ Items requiring user review (Low-confidence assumptions):
> - <TBC-ID>: <question> ← Assumed: <answer>
> - (or "None — all assumptions were High/Med confidence")
**Artifacts**:
- SRS: `docs/output/ipa-docs/srs/srs-<MOD-ID>-<module-short-name>.md`
- BD: `docs/output/ipa-docs/bd/bd-<MOD-ID>-<module-short-name>.md`
- Spec: `specs/<feature-id>/spec.md`
- Clarification Q&A: `docs/output/output_logs/<feature-id>/reports/04-clarify-qa.md`
- Plan: `specs/<feature-id>/plan.md`
- DD: `docs/output/ipa-docs/dd/dd-<MOD-ID>-<module-short-name>.md`
- Tasks: `specs/<feature-id>/tasks.md`
- Implementation: `src/modules/<module>/`
- Verified: Feature accessible on screen ✅
**Execution Logs & Reports**: `docs/output/output_logs/<feature-id>/`
| # | Report File |
|---|-------------|
| 0 | `00-boss.log.md` |
| 1 | `reports/01-srs-report.md` |
| 2 | `reports/02-bd-report.md` |
| 3 | `reports/03-specify-report.md` |
| 4 | `reports/04-clarify-report.md` |
| 5 | `reports/05-review-spec-report.md` |
| 6 | `reports/06-plan-report.md` |
| 7 | `reports/07-review-plan-report.md` |
| 8 | `reports/08-dd-report.md` |
| 8b | `reports/08b-testcases-report.md` |
| 9 | `reports/09-tasks-report.md` |
| 10 | `reports/10-implement-report.md` |
| 11 | `reports/11-review-code-report.md` |
| 12 | `reports/12-testkit-report.md` + `docs/output/ipa-docs/testreport/testreport-<MOD-ID>-*.md` |
| 13 | `reports/13-launch-report.md` |
```
@@ -0,0 +1,102 @@
# Phase Report Templates
Sub-agents SHOULD reference these templates instead of embedding full report structures inline.
Read the appropriate template file BEFORE writing your phase report.
## Universal Report Structure
Every phase report MUST include these sections (in Vietnamese):
```markdown
# STEP <NN>: <Report Title>
## Summary
- **Target Feature:** <feature name>
- **Created At:** <yyyy-MM-dd HH:mm:ss>
- **Agent:** <agent-name> (<model>)
- **Result:** ✅ Success / ❌ Failure
## Input
- <list input files>
## Output
| # | File | Path |
|---|---------|------|
| 1 | <file> | <path> |
## Key Decisions
- <list important decisions>
## Quality Assessment
| Category | Result |
|---------|------|
| <category> | ✅ / ❌ |
## Metrics
| Metric | Value |
|-----------|-----|
| <metric> | <N> |
## [AUTO-RESOLVED] Assumptions
| # | ID | Original Question | Automatic Answer | Rationale | Confidence |
|---|----|---------|---------|------|--------|
> If none apply: "No auto-resolved items."
## [NEEDS CLARIFICATION] Items
| # | ID | Description | Impact | Related |
|---|----|------|--------|------|
> If there are no unresolved items: "No unresolved items — all requirements are clear."
## Issues & Retries
> If there were no issues or retries: "No issues or retries."
## Next Step
- Next phase: `<agent>` (STEP N+1) — <purpose>
- Input: `<path>`
```
## Step-Specific Titles & Extra Sections
| NN | Report Title | Agent | Extra Sections |
|----|-------------|-------|----------------|
| 01 | SRS Generation Report | okr.srs | — |
| 02 | BD Generation Report | okr.bd | — |
| 03 | Specification Creation Report | speckit.specify | — |
| 04 | Specification Clarification Report | speckit.clarify | `## QA Summary` (full question + answer table) |
| 05 | Specification Review Report | okr.reviewspec | `## CRITICAL Issues` |
| 06 | Implementation Plan Report | speckit.plan | — |
| 07 | Plan Review Report | okr.reviewplan | `## CRITICAL Issues` |
| 08 | DD Generation Report | okr.dd | — |
| 08b | Test Case Generation Report | okr.testkit | — |
| 09 | Task Generation Report | speckit.tasks | — |
| 10 | Implementation and Build Verification Report | speckit.implement | `## Test Results`, `## Screen Verification` |
| 11 | Code Review Report | okr.reviewcode | `## CRITICAL Issues`, `## Architecture Assessment` |
| 12 | Test Execution Report | okr.testkit | `## Test Execution Summary`, `## Failed Test Details`, `## Coverage`, `## Overall Verdict` |
| 13 | Launch Report | Boss (direct) | `## Launch Status` |
## Review Agent Verdict Sections (Steps 5, 7, 11)
Review agents add:
```markdown
## Review Results
| Category | Result | CRITICAL | MINOR |
|---------|------|----------|-------|
## CRITICAL Issues
| # | Issue | Impact | Recommended Action |
|---|------|------|----------|
> If there are no critical issues: "No CRITICAL issues."
```
## Generation Agent Quality Sections (Steps 1, 2, 3, 6, 8, 9)
Generation agents include step-specific metrics in the `## Metrics` table. Examples:
- **SRS:** FEA count, TBC count, requirement count
- **BD:** screen count, logical table count, external interface count
- **Spec:** user story count, functional requirement count, screen count
- **Plan:** entity count, contract count, implementation phase count
- **DD:** physical table count, API count, batch job count
- **Tasks:** task count, phase count, dependency link count