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,65 @@
===== H4: prompt-injection bypass resistance =====
PASS: H4 blocks whitespace-padded injection (rc=2)
PASS: H4 blocks leetspeak injection (rc=2)
PASS: H4 blocks synonym injection (rc=2)
PASS: H4 blocks forget-variant injection (rc=2)
PASS: H4 blocks uppercase injection (rc=2)
===== H4: secret material must not pass as input =====
PASS: H4 blocks private key input (rc=2)
PASS: H4 blocks DB connection string input (rc=2)
===== H4: output mode fails closed on secret material =====
PASS: H4 fails closed on secret in output (rc=2)
===== H4: benign content must pass (no false positives) =====
PASS: H4 allows benign spec text (rc=0)
===== H5: separation of duties =====
PASS: H5 denies self-approval (actor==approver) (rc=2)
PASS: H5 allows distinct approver (rc=0)
===== H5: audit chain re-forge is detected =====
PASS: H5 verifies the genuine signed chain (rc=0)
PASS: H5 rejects a re-forged chain (signature anchor) (rc=1)
===== H2: per-agent least privilege =====
PASS: H2 denies unauthorized agent for deploy (rc=2)
PASS: H2 denies missing agent identity for deploy (rc=2)
PASS: H2 allows authorized agent with key (rc=0)
===== H2: tool-registry gate is in the execution line of fire =====
PASS: H2 wrapper aborts side-effect for unauthorized agent (rc=2)
PASS: H2 wrapper allows side-effect for authorized agent (rc=0)
===== H2: tool-call audit re-forge is detected =====
PASS: H2 verifies the genuine tool audit (rc=0)
PASS: H2 rejects a re-forged tool audit (rc=1)
===== H6: hallucination detection is populated =====
PASS: H6 populates hallucination_signals (count=4)
PASS: H6 reports 0 signals for clean output
===== PUSH-TO-90: H7 real rollback (genuine undo, not a marker) =====
PASS: H7 rollback genuinely restores the file
===== PUSH-TO-90: H7 real drift (two different artifacts, not cp-of-self) =====
PASS: H7 drift detects real difference (similarity=0.661 < 1.0)
PASS: H7 drift passes identical artifacts
===== PUSH-TO-90: H7 fallback triggered by a REAL primary failure =====
PASS: H7 fallback runs after a genuine primary failure
===== PUSH-TO-90: H2 runtime rate limit (deploy capped at 2/run) =====
PASS: H2 denies 3rd deploy in one run (rate limit)
===== PUSH-TO-90: H2 tool-input schema validation =====
PASS: H2 schema accepts valid tool input
PASS: H2 schema rejects malformed tool input (rc=2)
===== PUSH-TO-90: H4 tool-execution timeout =====
PASS: H4 kills a runaway tool call (rc=124)
PASS: H4 allows a fast tool call (rc=0)
===== PUSH-TO-90: H1 context path validation =====
PASS: H1 context-validate passes when artifact exists
PASS: H1 context-validate catches a missing artifact (rc=2)
===== PUSH-TO-90: H5 signing private key is OFF-REPO =====
PASS: H5 private signing key absent from repo
===== WAVE 3: H4 indirect artifact injection (WP-S7) =====
PASS: H4 artifact-scan blocks injected content in artifacts
PASS: H4 artifact-scan passes clean artifacts
===== WAVE 3: H4 secrets scan — no leaked keys (WP-S4) =====
PASS: H4 secrets scan passes (no committed .env or private keys)
===== WAVE 3: H4 circuit breaker — no bypass patterns (WP-S6) =====
PASS: H4 no bypass patterns; circuit breaker closed
===== WAVE 3: H4 tool-exec.sh wired into harness — kills runaway via harness =====
PASS: H4 tool-exec timeout fires through casan-harness.sh
===== WAVE 3: H3 judge gate fail-before (WP-B) =====
PASS: H3 judge gate T1-T4 all pass (fail-before and fix cycle)
===== ADVERSARIAL SUMMARY: PASS=40 FAIL=0 =====
@@ -0,0 +1,14 @@
> @ainative-okr/frontend@1.0.0 test
> vitest run
 RUN  v3.2.6 C:/work/Harness_Hakathon/casan5/AINative_OKR_CASAN5/frontend
✓ src/__tests__/okr.test.tsx (16 tests) 73ms
 Test Files  1 passed (1)
 Tests  16 passed (16)
 Start at  02:16:31
 Duration  44.35s (transform 383ms, setup 6.98s, collect 4.07s, tests 73ms, environment 21.55s, prepare 444ms)
@@ -0,0 +1,10 @@
== CASAN security gate ==
GATE PASS run-casan4 harness suite
GATE PASS adversarial suite
GATE PASS audit hash-chain (signed)
GATE PASS tool-call audit (signed)
GATE PASS secrets scan (WP-S4)
GATE PASS no-bypass + circuit breaker
GATE SKIP model router + red-team + judge-gate (Ollama tunnel down)
GATE PASS frontend runtime tests (WV4-A)
== verdict: PASS=7 FAIL=0 SKIP=1 ==