Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
lcov.info
doc/

# pnpm / Node.js
node_modules/
pnpm-lock.yaml

# IDEs and editors
.idea/
*.sublime-workspace
Expand Down
5 changes: 5 additions & 0 deletions aidlc-docs/aidlc-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
## Stage Progress

### 🔵 INCEPTION PHASE (US-021/US-022)

- [x] Workspace Detection
- [x] Requirements Analysis
- [x] Workflow Planning
Expand Down Expand Up @@ -99,3 +100,7 @@
- [x] CI Phase 2 (k6 Compatibility Verification Suite) — COMPLETED (GitHub
Actions workflow at `.github/workflows/ci-phase2.yml`; reclassified from
the UOW-05 compatibility-check workflow per user request on 2026-07-07)
- [x] TypeScript Linter/Formatter Setup — COMPLETED (oxfmt.config.ts and
oxlint.config.ts customized for project; root package.json with pnpm added
for oxlint/oxfmt devDependencies; Build and Test docs updated to require
lint/format passing)
62 changes: 46 additions & 16 deletions aidlc-docs/audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,24 +449,24 @@ value-object round trips」の方が設定に適合
### 具体的な改善提案

1. **耐障害性設計の再検討**:
- 選択A → 選択Bへ変更
- 構造化ログ/アラート発行のための最低限のリトライ戦略を導入
- 選択A → 選択Bへ変更
- 構造化ログ/アラート発行のための最低限のリトライ戦略を導入

2. **キャッシュ戦略の再評価**:
- 選択A → 選択Bへ変更
- パフォーマンス要件達成のための短TTLキャッシュを導入
- 選択A → 選択Bへ変更
- パフォーマンス要件達成のための短TTLキャッシュを導入

3. **論理コンポーネント設計の簡素化**:
- 選択B → 選択Aへ変更
- 単一ノード環境での複雑性を削減
- 選択B → 選択Aへ変更
- 単一ノード環境での複雑性を削減

4. **アラート設計の具体化**:
- 具体的なしきい値とエスカレーションルールを追加
- 例: 「2回の警告 → 1時間以内に改善なければ重大アラート」
- 具体的なしきい値とエスカレーションルールを追加
- 例: 「2回の警告 → 1時間以内に改善なければ重大アラート」

5. **プロパティベーステスト統合の調整**:
- 選択A → 選択Bへ変更
- 設定の「部分的な適用」に準拠
- 選択A → 選択Bへ変更
- 設定の「部分的な適用」に準拠

### 総合評価

Expand Down Expand Up @@ -800,13 +800,14 @@ stage executed with Docker-based integration testcontainers.
**Timestamp**: 2026-06-20T00:01:00Z
**User Input**: (automatic — test suite execution)
**AI Response**: All tests passed:

- Unit tests: 8/8 passed
- Core tests: 33/33 passed (includes new PBT tests: `auth_error_serialization_round_trip`, `token_format_round_trip`)
- Auth integration tests: 3 tests (ignored — require Docker daemon)
- Accounts API tests: 7 tests (1 passed, 6 ignored — require Docker)
- Transactions API tests: 6 tests (ignored — require Docker)
- DB integration test: 1 (ignored — requires Docker)
**Context**: Build and Test execution results.
**Context**: Build and Test execution results.

---

Expand Down Expand Up @@ -842,11 +843,12 @@ stage executed with Docker-based integration testcontainers.
**Timestamp**: 2026-06-27T00:03:00Z
**User Input**: "1にします。回答記入してください。"
**AI Response**: User selected Option 1 (recommended configuration). Updated answers:

- Q3: B (OpenAPI spec + sample responses)
- Q5: A (Strict mode)
- Q7: B (Seed data)
All answers received. Proceeding to generate requirements document.
**Context**: Requirements Analysis answers completed for UOW-05.
All answers received. Proceeding to generate requirements document.
**Context**: Requirements Analysis answers completed for UOW-05.

---

Expand All @@ -855,6 +857,7 @@ All answers received. Proceeding to generate requirements document.
**Timestamp**: 2026-06-27T00:04:00Z
**User Input**: "Using AI-DLC, このファイルを回答しました。続行してください。"
**AI Response**: All 7 [Answer] fields confirmed in uow05-requirement-verification-questions.md:

- Q1: A (Firefly-III v6.x latest stable)
- Q2: B (Currently implemented endpoints only)
- Q3: B (Manually define expected response schemas from Firefly-III OpenAPI spec)
Expand All @@ -866,8 +869,8 @@ All answers received. Proceeding to generate requirements document.
No blocking ambiguities detected. Proceeding to generate requirements.md for UOW-05.
**Context**: Requirements Analysis answers confirmed. Generating requirements document.


## INCEPTION — Workflow Planning Approval (UOW-05)

**Timestamp**: 2026-06-27T04:04:50Z
**User Input**: "Using AI-DLC, 承認してWorkflow Planningに進んでください。"
**AI Response**: Workflow Planning for UOW-05 approved. Execution plan created with phases: NFR Requirements → NFR Design → Code Generation → Build & Test. Transitioning to NFR Requirements stage.
Expand All @@ -876,6 +879,7 @@ No blocking ambiguities detected. Proceeding to generate requirements.md for UOW
---

## INCEPTION — Workflow Planning Approval Response (UOW-05)

**Timestamp**: 2026-06-27T04:34:51Z
**User Input**: "承認して続行します。"
**AI Response**: Workflow Planning for UOW-05 approved. Proceeding to NFR Requirements stage.
Expand All @@ -884,6 +888,7 @@ No blocking ambiguities detected. Proceeding to generate requirements.md for UOW
---

## CONSTRUCTION — Code Generation Part 1 Approval (UOW-05)

**Timestamp**: 2026-06-27T05:00:00Z
**User Input**: "Using AI-DLC, Code Generation Part 1を承認します。Code Generation Part 2に進んでください。"
**AI Response**: Code Generation Part 1 plan approved. Proceeding to Part 2 execution: creating seed data generator, k6 fixtures, test harness, test scripts, runner script, Docker Compose service, GitHub Actions workflow, and .env.example updates.
Expand All @@ -892,9 +897,11 @@ No blocking ambiguities detected. Proceeding to generate requirements.md for UOW
---

## CONSTRUCTION — Code Generation Part 2 Execution (UOW-05)

**Timestamp**: 2026-06-27T05:01:00Z
**User Input**: (automatic — Part 2 execution)
**AI Response**: All 12 steps executed:

- Step 1: Created seed data generator (scripts/seed/) — package.json, index.ts, types.ts, accounts.ts, transactions.ts
- Step 2: Created k6 test fixtures (k6/fixtures/) — auth.json, accounts.json, transactions.json
- Step 3: Created k6 test harness (k6/harness.ts) — shared utilities for auth, validation, pagination
Expand All @@ -907,7 +914,7 @@ No blocking ambiguities detected. Proceeding to generate requirements.md for UOW
- Step 10: Updated .env.example with k6 environment variables
- Step 11: Created code summary document (aidlc-docs/construction/compatibility-verification-suite/code/code-summary.md)
- Step 12: Validated all artifacts — all files in correct locations, no aidlc-docs/ pollution
**Context**: Code Generation Part 2 execution complete for UOW-05 Compatibility Verification Suite.
**Context**: Code Generation Part 2 execution complete for UOW-05 Compatibility Verification Suite.

---

Expand All @@ -919,6 +926,7 @@ No blocking ambiguities detected. Proceeding to generate requirements.md for UOW
**Context**: Build and Test stage for UOW-05 Compatibility Verification Suite. All units (UOW-01 through UOW-05) now complete through Build and Test.

### Actions Taken

- Updated build-instructions.md: Added k6/Bun prerequisites, seed generator build step, k6 installation verification
- Updated unit-test-instructions.md: Added firefly_error_contract_test, UOW-05 compatibility contract test table
- Updated integration-test-instructions.md: Added Scenario 3 (Accounts API) and Scenario 4 (Transactions API) for Firefly-III compatibility
Expand All @@ -934,11 +942,33 @@ No blocking ambiguities detected. Proceeding to generate requirements.md for UOW
**Timestamp**: 2026-07-07T00:00:00Z
**User Input**: "k6でのテストをCI Phase 2として扱ってください。"
**AI Response**: Reclassified the k6 Compatibility Verification Suite as CI Phase 2. Actions taken:

- Renamed `.github/workflows/compatibility-check.yml` → `.github/workflows/ci-phase2.yml` (via `git mv`)
- Updated workflow `name:` to "CI Phase 2 — k6 Compatibility Verification Suite"
- Updated `aidlc-state.md` Post-Workflow section: CI Phase 2 Hardening (SKIPPED) replaced with CI Phase 2 (k6 Compatibility Verification Suite) — COMPLETED
- Updated `build-and-test-summary.md` CI Automation Status: added Phase 2 workflow entry and required k6 checks
- Updated `build-instructions.md` CI Execution Mapping: added Phase 2 section (trigger policy, blocking k6 checks, prerequisites)
**Context**: User requested k6 tests be treated as CI Phase 2. Previously CI Phase 2 Hardening was marked SKIPPED (user decision on 2026-06-11); the k6 compatibility workflow now fulfills the Phase 2 slot.
**Context**: User requested k6 tests be treated as CI Phase 2. Previously CI Phase 2 Hardening was marked SKIPPED (user decision on 2026-06-11); the k6 compatibility workflow now fulfills the Phase 2 slot.

---

## Post-Completion Enhancement — TypeScript Linter/Formatter Setup

**Timestamp**: 2026-07-07T00:00:00Z
**User Input**: "Using AI-DLC, このプロジェクトのTypeScriptファイルに、LinterとFormatterしてoxlintとoxfmtを適用したい。現在存在するoxfmt.config.tsとoxlint.config.tsは別のプロジェクトで使っているものをそのままコピーしたので、これをカスタムして規則としたい。また、Build and TestフェーズでLinterとFormatterがパスすることを強制するよう、記述したい。質問があればいつでも聞いてください。"
**AI Response**: Gathered project context — Rust/Axum backend with TypeScript files in k6/ (compatibility tests) and scripts/ (seed data, CI setup). Current oxfmt/oxlint configs were copied from a different project. Asked clarifying questions about scope, CI integration, and package manager.

User answers:

- Scope: All TypeScript files (k6/ + scripts/)
- CI integration: Not added to CI (local dev tools only)
- Package manager: pnpm

Customized oxfmt.config.ts: removed irrelevant ignore patterns (prisma/generated), added k6-specific formatting overrides, adjusted JSON options, added scripts/seed override for double-quote preservation (seed files use double quotes habitually).

Customized oxlint.config.ts: removed vitest plugin/rule, removed import plugin (requires build-time resolution not set up), adjusted ignore patterns for this project, added k6-specific overrides (k6 globals, console.warn exemption), relaxed explicit-function-return-type for seed scripts, adjusted rules for project-specific patterns.

Created root package.json with pnpm as package manager, added oxlint and oxfmt as devDependencies with format/lint scripts.

Updated build-and-test documentation (build-instructions.md and build-and-test-summary.md) to reference TypeScript linting and formatting as required local checks.
**Context**: Post-completion enhancement — TypeScript tooling configuration and Build & Test documentation update.
22 changes: 22 additions & 0 deletions aidlc-docs/construction/build-and-test/build-and-test-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
- Docker image utopia-api:0.1.0
- Seed data generator (Bun/TypeScript at `scripts/seed/`)
- k6 compatibility test suite (at `k6/`)
- TypeScript tooling: oxlint (linter) and oxfmt (formatter) via pnpm
- Config: `oxlint.config.ts` and `oxfmt.config.ts`
- Scope: `scripts/`, `k6/`, and project config files
- CI enforcement: Local check (not enforced in CI Phase 1)
- Build time: ~5s (debug), ~8s (test with integration)

## Test Execution Summary
Expand Down Expand Up @@ -88,6 +92,24 @@
- Deployment automation: not included in current phase
- Compatibility workflow: automated on PR to main (k6 suite + artifact upload)

## TypeScript Code Quality

- **Formatting**: oxfmt (single quotes, 120 print width, sorted imports)
- **Linting**: oxlint with ESLint, Oxc, TypeScript, Unicorn, and Promise rules
- **Scope**: `scripts/ci/`, `scripts/seed/`, `k6/`, `oxlint.config.ts`, `oxfmt.config.ts`
- **Required local checks** (must pass before committing):
```bash
pnpm fmt:check # Verify formatting
pnpm lint # Verify lint rules
```
- **Auto-fix commands**:
```bash
pnpm fmt # Format all files
pnpm lint:fix # Auto-fix lint issues
```
- **Note**: TypeScript lint/format is not enforced in CI Phase 1. These are
local development quality gates.

## Overall Status

- **Build**: ✅ Build verified (debug mode)
Expand Down
32 changes: 27 additions & 5 deletions aidlc-docs/construction/build-and-test/build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Optional observability stack: Prometheus and Grafana containers from compose profile
- k6 testing: k6 CLI (v0.50+) or Docker k6 image (grafana/k6:latest)
- Seed runtime: Bun runtime (v1.0+) for seed data generator
- TypeScript tooling: pnpm (v9+) for oxlint and oxfmt
- System requirements: Linux host, 4+ CPU cores, 8+ GB RAM, 20+ GB free disk

## Required Environment Variables
Expand Down Expand Up @@ -43,20 +44,41 @@ cp .env.example .env
# Edit .env values for your environment
```

### 3. Build Application
### 3. TypeScript Lint and Format
All TypeScript source files (scripts/, k6/, and config files) must pass formatting
and lint checks before merge.

```bash
# Install dependencies (first time only)
pnpm install

# Check formatting
pnpm fmt:check

# Lint
pnpm lint

# Fix formatting issues
pnpm fmt

# Fix auto-fixable lint issues
pnpm lint:fix
```

### 4. Build Application
```bash
cargo fmt --all --check
cargo clippy --all-targets --all-features -- -D warnings
cargo build
cargo build --release
```

### 4. Build Container Image
### 5. Build Container Image
```bash
docker build -t utopia-api:0.1.0 .
```

### 5. Verify Build Output
### 6. Verify Build Output
Expected output:
- Cargo build completes with Finished profile messages
- Docker build completes with tagged image utopia-api:0.1.0
Expand All @@ -66,14 +88,14 @@ Build artifacts:
- target/release/utopia
- Docker image utopia-api:0.1.0

### 6. Build Seed Data Generator (UOW-05)
### 7. Build Seed Data Generator (UOW-05)
```bash
cd scripts/seed
bun install
cd ../..
```

### 7. Verify k6 Installation (UOW-05)
### 8. Verify k6 Installation (UOW-05)
```bash
# Option A: Native k6
k6 version
Expand Down
Loading
Loading